Changeset 29066 for trunk/admin/include


Ignore:
Timestamp:
Jul 21, 2014, 11:00:17 PM (10 years ago)
Author:
rvelices
Message:

bug 3101: Allow multi language tags to be recognized from selectize or metadata sync

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r29052 r29066  
    15541554  if (count($existing_tags = query2array($query, null, 'id')) == 0)
    15551555  {
    1556     // search existing by case insensitive name
     1556    $url_name = trigger_change('render_tag_url', $tag_name);
     1557    // search existing by url name
    15571558    $query = '
    15581559SELECT id
    15591560  FROM '.TAGS_TABLE.'
    1560   WHERE CONVERT(name, CHAR) = \''.$tag_name.'\'
     1561  WHERE url_name = \''.$url_name.'\'
    15611562;';
    15621563    if (count($existing_tags = query2array($query, null, 'id')) == 0)
    15631564    {
    1564       $url_name = trigger_change('render_tag_url', $tag_name);
    1565       // search existing by url name
    1566       $query = '
     1565      // search by extended description (plugin sub name)
     1566      $sub_name_where = trigger_change('get_tag_name_like_where', array(), $tag_name);
     1567      if (count($sub_name_where))
     1568      {
     1569        $query = '
    15671570SELECT id
    15681571  FROM '.TAGS_TABLE.'
    1569   WHERE url_name = \''.$url_name.'\'
    1570 ;';
    1571       if (count($existing_tags = query2array($query, null, 'id')) == 0)
    1572       {
     1572  WHERE '.implode(' OR ', $sub_name_where).'
     1573;';
     1574        $existing_tags = query2array($query, null, 'id');
     1575      }
     1576     
     1577      if (count($existing_tags) == 0)
     1578      {// finally create the tag
    15731579        mass_inserts(
    15741580          TAGS_TABLE,
Note: See TracChangeset for help on using the changeset viewer.