I'm in the process of trying to upgrade my D6 modules to D7, based on the D7 alpha1 release.

One of my modules makes use of taxonomy synonyms, and I noticed that the taxonomy_get_synonyms function, which existed in D6, doesn't appear to be in D7. This is confirmed by the API page at http://api.drupal.org/api/function/taxonomy_get_synonyms.

Then, looking at the edit vocabulary page, I noticed that not only does the taxonomy_get_synonyms function not exist, but synonyms for taxonomy terms appeared to have been removed altogether.... is this right, or have they simply moved?! It looks like I can extend a taxonomy term type using the "Manage Fields" option, but none of the field types appear to work in the same way that synonyms did (i.e. allowing a one->zero or more relationship between a termID and any number of synonymous term names).

Looking at the conversion guide at http://drupal.org/node/224333, I've read all the listed information about taxonomy hook changes, but I can't see any reference to taxonomy synonyms being removed/replaced, and a search of drupal.org hasn't revealed anything either...

Can anybody help advise how I can implement synonymous term names for a given term ID in D7? (and maybe help to list this information on the conversion guide page)? My primary focus is to ensure that when any synonym is entered as a search term, nodes tagged with a term that is synonymous to that term appear.
So, say that I define "england", "great britain", and "britain" as synonyms for "united kingdom" [ignore the fact they're not!], I want a search for any of these terms to return the same results as if I had searched for "united kingdom" - the term with which they are actually tagged. This was easy to achieve in D6 using taxonomy + the synonyms module (http://drupal.org/project/synonyms)

Thanks for any help.

Comments

kscheirer’s picture

you're right, this functionality was removed and replaced by using the Field API in core.

here is the issue you're looking for: #526120: Remove related terms from core now that terms can have a term reference field

Sorry I don't have more information on how to recreate this functionality in D7.

tanoshimi’s picture

Thanks for the response - that issue seems to relate to removing related terms from core though, not synonyms.

If you look at the before.png and after.png screenshots posted in #18, you'll see that the synonyms box is still shown in the after.png following the patch.

tanoshimi’s picture

I've just checked back at an installation I head of Drupal7 HEAD from 2009/09/14, and the taxonomy_term_synonym table still exists there (and I notice it has been updated to use the new D7 "taxonomy_" table prefix).
The change to remove synonyms can therefore only have been committed in the last few months (which I thought was after the code freeze came in...?).

Assuming that the decision to remove synonyms is deliberate (following the same logic as the "related terms" thread above), then I'm trying to work out how to duplicate the synonyms functionality in D7, but I'm hampered at the moment by the fact that adding fields seems to be broken in alpha1 (see http://drupal.org/node/614030).
As soon as I work out how, I'll post back my findings here, but if anybody else has tried I'd be happy to receive their input!

asimmonds’s picture

The taxonomy synonyms removal issue is #567572: Remove taxonomy synonyms since Field API is better

Committed on 16-Oct-09

tanoshimi’s picture

Well, it's very well hidden and doesn't appear to show up on any searches, but I eventually managed to find:
http://drupal.org/node/567572, which shows that the patch to remove term synonyms was committed on 15/10/2009 (odd, since it seems that up until this point there had been some progress on making synonym management more useful in D7).

I've asked for the 6.x -> 7.x Module conversion guide to be updated - http://drupal.org/node/704368

Guess I need to do a crash course in how the Fields UI works in order to recreate this! (Or, as a dirty fix, I'll simply have to reinstate the way that synonyms used to work and commit it as a contrib module for D7, but that seems wrong....)

tanoshimi’s picture

Thanks - I just found it at exactly the same time!

xjm’s picture

Status: Active » Closed (fixed)
csc4’s picture

Belatedly following the trail of the missing Synonyms... also found https://drupal.org/project/synonyms