Hi,

For a project we are trying to reduce term complexity by using a module which checks if the tag introduced by the user is a synonym and if so replace it with the super-term. In other words we want to avoid having a term page for "nyc" and other for "new york city". We want a page with all the synonyms.

None of our attempts to do it worked so far (modules "synonyms" "synonym collapsing" and "unitag"). So my question is.. Is there something in FBSS preventing those modules to work properly?

Comments

raulmuroc’s picture

Priority: Normal » Critical

SUBSCRIBING

raulmuroc’s picture

First idea for patch (I must figure out how to create, test and apply patches...sorry for that):

function term_synonym_redirect(){
  $vocabularies = taxonomy_get_vocabularies('profile');
  foreach ($vocabularies as $index){
    if ($index->name == "hashtags"){   /** Line not necessary if taxonomy_get_vocabularies got a type parameter */
      $terms = taxonomy_get_tree($index->vid);
      foreach ($terms as $term){
        $synonyms = taxonomy_get_synonyms($term->tid);
        foreach ($synonyms as $synonym){
          if (isset($synonym)){
            drupal_goto('statuses/term/'.$term->name); /*or $term->tid as well*/
          }
        }
      }    
    }
  }
}
icecreamyou’s picture

Category: feature » support
Priority: Critical » Normal
Status: Active » Fixed

Is there something in FBSS preventing those modules to work properly?

No, but you probably have a misconception about what those modules do. Presumably those modules are designed to work with taxonomy term pages. But when you click a #hashtag, you're taken to a page generated by the facebook_status_tags View.

RaulMuroc's approach seems reasonable to me, but new features aren't going into either of the D6 branches right now. There are also some caveats -- for example, that approach assumes that the first term created is the one all its synonyms should redirect to -- and there are more efficient ways of doing it (just load the hashtags vocabulary and the current page's term directly).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

raulmuroc’s picture

Version: 6.x-2.4 » 6.x-3.0-rc3
Priority: Normal » Major
Status: Closed (fixed) » Active

It is not fixed.

FBSS + Synonyms does not exist at all.

Tried FBSS +...
... synonyms collapsing
... unitag
... term merge
... so on.

Code written before is not completely ok. It would redirect synonyms to base term page so that if in base term are 3 nodes and synonyms has 20 nodes term, they will be shonw just those 3, like if 20 does not exist.

It is necessary a solution because it is weird to have a #hashtags style without this functionality.

Thanks a lot, I am trying to solve but not becoming succesful.

icecreamyou’s picture

Project: Facebook-style Statuses (Microblog) » Statuses (Social Microblog)
Version: 6.x-3.0-rc3 » 7.x-1.x-dev
Component: Submodules » Tags submodule
Category: support » feature
Priority: Major » Normal
Status: Active » Postponed

No new features are going into the 6.x-3.x or 7.x-1.x branches. Postponing to 7.x-2.x.

raulmuroc’s picture

Is it possible to port a website developed under drupal 6 to drupal 7 without lose the things? BEcause we need this functionality, but work on 6.x if is not going to be further developed does not have sense.

Thanks, when answer, it can be closed for me.

icecreamyou’s picture

Is it possible to port a website developed under drupal 6 to drupal 7 without lose the things?

There is no upgrade path to D7 right now, although writing one is fairly trivial. Additionally FBSMP has not been ported, and some of the submodules (notably Rules integration) are not working. Other than that it seems to be pretty stable.

BEcause we need this functionality, but work on 6.x if is not going to be further developed does not have sense.

The 6.x branch is extremely stable; the reason to build on it is that it won't break. Tags were not really designed with synonyms in mind because they are by nature arbitrary. Anyone can create any #hashtag they want, so the administrative overhead of having to go through all the #hashtags and create synonyms is very high. Also note that the 7.x-1.x branch isn't getting new features either, although I'm a lot more open to it if someone else writes a solid patch.

Don't close this issue yet -- it's a valid feature request that should get in eventually.

raulmuroc’s picture

Assigned: Unassigned » raulmuroc

A posible implementation to get realted terms work as synonyms:

// @file mymodule.views.inc

/**
* Implementation of hook_views_handlers().
*/
function mymodule_views_handlers() {
  return array(
    'info' => array(
      'path' => drupal_get_path('module', 'mymodule'),
    ),
    'handlers' => array(
      'mymodule_handler_argument_term_data_name_extra' => array(
        'parent' => 'views_handler_argument_string',
      ),
    ),
  );
}

/**
* Implementation of hook_views_data_alter().
*/
function mymodule_views_data_alter(&$data) {
  $data['term_data']['name']['argument']['handler'] = 'mymodule_handler_argument_term_data_name_extra';
}

And now the part of the code where the query is generated:

// @file mymodule_handler_argument_term_data_name_extra.inc

class mymodule_handler_argument_term_data_name_extra extends views_handler_argument_string {
  function query() {
    $this->ensure_my_table();
    $this->query->add_where(0, "
      $this->table_alias.$this->real_field = '%s' OR
      $this->table_alias.tid IN (
        SELECT _tr.tid1 FROM {term_relation} _tr
        INNER JOIN {term_data} _td ON _tr.tid2 = _td.tid
        WHERE _td.name = '%s'
        UNION SELECT _tr.tid2 FROM {term_relation} _tr
        INNER JOIN {term_data} _td ON _tr.tid1 = _td.tid
        WHERE _td.name = '%s'
        UNION SELECT _ts.tid FROM {term_synonym} _ts
        WHERE _ts.name = '%s'
      )
    ", $this->argument, $this->argument, $this->argument, $this->argument);
  }
}

NOTE: Implement hook_views_api so that Views can detect your module. Clear your caches. The regular term argument handler should now be replaced with this new one.

Apparently it works. Hope it does not break in the future.

raulmuroc’s picture

Status: Postponed » Active

Statuses is currently working :-) so let's set this active!

icecreamyou’s picture

Status: Active » Postponed

From #6:

No new features are going into the 6.x-3.x or 7.x-1.x branches. Postponing to 7.x-2.x.

raulmuroc’s picture

Assigned: raulmuroc » Unassigned
Priority: Normal » Major
Status: Postponed » Active

This is just not moving on. Where is 7.x-2.x-dev?

mathankumarc’s picture

Priority: Major » Normal
Status: Active » Postponed

Once the 7.x-2.x stable release is done, we will kick start on 7.x-2.x.

Until that postponing the issue as per #11

raulmuroc’s picture

Is some date forecasted to begin with the 7.x-2.x development?

icecreamyou’s picture

I wish I even knew when 1.x would be done. :-)

raulmuroc’s picture

Perhaps we could work to integrate this on 7.x-1.x branch? Is no more people interested on this feature?

raulmuroc’s picture

Title: Use of synonym related modules » Statuses (Social Microbolg) with synonyms

Perhaps more people will be aware of this nice feature request.

raulmuroc’s picture

2 years have passed since this was open... will be 2 years more? That case we should begin thinking on other modules as alternative.

thanks.

raulmuroc’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

Nice and useful feature but is looking won't be implemented because of missing maintainers.