Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Synonyms should be possible on all types of entities. The Synonyms module is the central repository for synonym handeling -> so it should expand to work on all entities. Content, Users, etc.
Comment | File | Size | Author |
---|---|---|---|
#24 | 1194802-entity-support-24.patch | 205.07 KB | bucefal91 |
#21 | 1194802-entity-support-21.patch | 197.74 KB | bucefal91 |
#20 | 1194802-entity-support-20.patch | 221.83 KB | bucefal91 |
#18 | 1194802-entity-support-18.patch | 219.13 KB | bucefal91 |
#16 | 1194802-entity-support-16.patch | 200.23 KB | bucefal91 |
Comments
Comment #1
bojanz CreditAttribution: bojanz commentedAgreed. The D7 code is very old (think early alphas), so it probably needs someone to do a rewrite.
Comment #2
bucefal91 CreditAttribution: bucefal91 commentedThis kind of idea never visited me, but I can see some future behind it, and yes, in D7 it becomes much easier to implement synonyms for all entity types...
But talking about user or comment entity type, what is the point to "synonymize" them? and for user, should we make synonyms of his/her username? or maybe of his/her email or let the website administrator to choose the field he wants the synonyms to be based on.
For comments I can't come up with any situation when you might need synonyms for them. I might be too short looking and such situations do exist.
Nevertheless, I think the most demand for synonyms comes exactly from taxonomy terms.
Comment #3
bucefal91 CreditAttribution: bucefal91 commentedI keep becoming more and more convinced that this way of development for this module is promising. The module itself is not yet completely mature for such a huge step, at least I think so. I need to give it time and let people use it and get some feedback. But from now on I will keep in mind this possible future path of development while writing code for this module.
Other people, feel free to subscribe to this issue. This way I will see the demand for synonyms for other entity types and together we shall eventually have it done at some point.
Comment #4
adam_b CreditAttribution: adam_b commented+1
Comment #5
ComboPrime CreditAttribution: ComboPrime commentedWe need this feature because our taxonomy terms are controlled (no free tagging)--so we have to use an entity reference field instead of a term reference field to add tags. But the Synonyms-friendly widget isn't compatible with the ER field, so it's impossible to get Synonyms working.
Comment #6
RaulMuroc CreditAttribution: RaulMuroc commented+1 for this feature!
Comment #7
bucefal91 CreditAttribution: bucefal91 commentedthanks for voting up here. I haven't forgotten about this issue ;) Will do my best to program it too, as soon as I can.
Comment #8
webby7097 CreditAttribution: webby7097 commentedI'd like to see this as well. Using the built in Glossary view, I'd like to be able to add synonyms for the different nodes there without having to create duplicate content.
Comment #9
bucefal91 CreditAttribution: bucefal91 commentedJust a small update here, I still remember about this feature request and actually as I am resolving other issues of this module and refactoring it, I am trying to start introducing enough flexibility to turn the synonyms into synonyms for all entity types at some point in the future. So even though there's no active visual work in this issue, I do keep it in mind and am taking it a tiny step by tiny step closer.
Comment #10
devad CreditAttribution: devad commented+1 for this.
Implementing this feature request would bring Synonyms closer to Drupal 8 as well.
Comment #11
bucefal91 CreditAttribution: bucefal91 commentedAlright, so the judgment day has come for this long anticipated feature. Here is my proposal:
admin/structure/taxonomy/[vocabulary]/edit
page (the "Synonyms" fieldset). It will be a table with fields from that entity type in rows and available synonyms behaviors as columns. Then website administrator will enable/disable necessary stuff.admin/structure/taxonomy/[vocabulary]/edit
, but I personally prefer to remove it, deprecate in favor of centralized page for management of synonyms. Though this item is entirely optional and folks vote to keep it, then at the moment I have no reasons to disobey their will.Guys, let's see whether you like this plan? I might have forgotten something (being in a noisy place with lots of distractions, so I couldn't fully brainstorm it).
Comment #12
bucefal91 CreditAttribution: bucefal91 commentedHello,
Let's see; here's the 1st mock up on the idea. It is still very far from being stable and well tested, though the core functionality is available.
The patch has 100% pass on the existing simpletests, which is good. Though lots of new simpletests have to be added.
Remaining items that I am aware of:
Comment #13
bucefal91 CreditAttribution: bucefal91 commentedSo, here's the new iteration on the subject. Since the last patch I got the following:
Remains:
Comment #14
effortDee CreditAttribution: effortDee commentedHi, im interested in entity reference with synonyms as I wish to use this for the flag module and show a flag say 'Is this a good node' and the synonyms be , calm, peaceful, at ease, etc.. Which are synonyms of 'good'.
Comment #15
bucefal91 CreditAttribution: bucefal91 commentedAlright, this patch is a very decent version. I've extended the tests to cover autocomplete widget and term synonyms ctools argument plugin. I made a quick search whether I can write a universal "any entity type" synonyms-friendly argument plugin but didn't find how to do it. It's not a show stopper, so we can leave it out.
We have 100% pass on all the tests and I have tested it manually. At the moment I have nothing more to code. I only would like to change the UI of Admin -> Structure -> Synonyms page (it looks way unfriendly to my eyes, I'll try to think of something different).
Feedback is very welcome!
Comment #16
bucefal91 CreditAttribution: bucefal91 commentedIntegration with Views (views handlers provided by Synonyms module) was broken, this patch takes care of it.
Comment #17
devad CreditAttribution: devad commentedHi bucefal91!
Nice work as always. :)
I didn't have time to play around with "Synonyms for all entity types" yet...
But I can confirm that simplytest.me configuration:
Synonyms 7.1.x + entityreference + patch #16
launches nicely without any errors.
So, if some more community members would like to test new "Synonyms for all entity types" they can do it simply online at: http://simplytest.me
I will defenitely do some tests myself soon... and post results here.
Thanx!
Comment #18
bucefal91 CreditAttribution: bucefal91 commentedIn the meantime I've manually tested my latest patch and made sure all existing views integration is functional. My tests revealed one issue, so here's the updated patch.
Also, I'll throw out the question to see what others think: Synonyms module obviously will now depend on entity API module. I currently think to block update.php script if entity API module is not installed/enabled supplying user friendly text explaining that from now on Synonyms module has this new dependency. Similarly, I'll include notifications of the same content into the release page and maybe Synonyms project homepage. Would this be enough or there's something more that I can do to facilitate this change in dependencies?
Thank you and hey! Put harder on testing ;) I will not commit this patch until I hear feedback from at least a few people.
Comment #19
devad CreditAttribution: devad commentedHi
I have tested current Synonyms .dev + patch #18 together with:
Entity Reference
Drupal Commerce
Term Merge
And results are VERY good.
A few minor issues I have posted as separate issues child-parent connected with this issue.
Aside from posted issues everything else looks great.
Entityreference fields have synonyms friendly autocomplete and select widgets available and they work nicely.
All Entities have their own Synonyms settings and they work nicely.
I have tested Term synonmys, Node synonyms, User synonyms and Commerce product synonyms for now, and they all work great.
Entityreference field of all these kinds of synonym entities works nicely with both autocomplete and select widgets giving properly suggestions from selected synonyms fields of particular enities. Tested with text, integer, decimal, term reference and entity reference field types.
Term Merge module integration looks good as well.
I think this patch is very close to be commited. But more reviews are welcome of course!
Comment #20
bucefal91 CreditAttribution: bucefal91 commentedHello!
Thank you, devad, for your persistent support. I saw the issues you've created. Most of them look as good directions for further extending Synonyms module. However, this one #2667322: Notice warnings at synonyms settings form save is basically feedback about the patch from this issue. I've fixed the issue you found. When I was testing, I was only testing it on the taxonomy term entities and that's why I overlooked it. Along the way I've fixed another subtle defect. So, here's the latest patch.
Comment #21
bucefal91 CreditAttribution: bucefal91 commentedI've rearranged some internal things in the SimpleTests (preparing Synonyms module to work with Drupal.org testbot). Functionally this patch is no different from the #20, so there's no need to re-test it.
Comment #22
devad CreditAttribution: devad commentedNot so many reviews. It seems that D8 is in focus now. :)
I didn't test upgrade path... but if you did and if upgrading works fine can you make commit to some kind of v.1.5-dev or new releace maybe?
Comment #23
bucefal91 CreditAttribution: bucefal91 commentedHello! :) Yeah, I was expecting quite triple more of reviews than what we've got so far. Silly they are for chasing D8. D7 is quite an awesome piece of software :) Not to mention, D8 does not have Synonyms module (this basically kills all the awesomeness of D8).
My rule of thumb is to give 2 weeks of time and then proceed further. It's about 2 weeks now. There's no update path yet. Not sure if I can do it during the weekend, I already have some arrangements, but I shall deliver it at some point during next week. We'll test it, I'll review the code for the last time and then this new code can go into development snapshot of the module.
I'll be back with a patch in regards to update path one of these days.
Comment #24
bucefal91 CreditAttribution: bucefal91 commentedHello,
Let's see if this one suits your needs. What I've done:
Devad, so we now have the update path. I've tried testing it from as many angles as I could come up with, but the updates are always tricky. Please, check it out. If you give green light on it, I'd like to let this last patch chill for another 5-7 days here in the issue (just in case somebody else does want to speak up). If we hear no extra feedback, I will commit it when those 5-7 days are up. Then you will be able to access whole functionality from this issue by simply installing 7.x-1.x-dev release (and I am quite confident the dev is stable right now). I am too afraid to tag a stable release right after it, I would like this code to chill for at least a month or few weeks in the dev release (in the meantime I'll try working on other issues we have opened). And then I'll tag a new stable release of Synonyms module with whatever we'll have in the dev snapshot by that time. How does my plan sound to you? Do you have any requests or questions?
Comment #26
bucefal91 CreditAttribution: bucefal91 commentedHoly cow! I've just committed it! :) Now it will reside in the development snapshot for some time. When I feel it got enough testing from the dev release, I'll tag a stable one.
Thank you, everyone, for your support and insisting on getting this feature done. Frankly, I never imagined myself resolving this issue :)
Comment #27
devad CreditAttribution: devad commentedHi.
I have done some basic testing of new .dev
I have enabled the module at nicely developed test site with many vocabularies, taxonomy reference and entity reference fields.
I have checked manually created "Price" decimal field of "Offer" content type to be used for synonyms select list suggestions.
Entityreference field which list nodes of type Offer gives synonyms suggestions which include price field nicely.
"836 is price field for offer Weekend in Prague"
Select list is shown by Chosen module and it works nicely.
So far so good. Nice job bucefal91! :)
Comment #29
bucefal91 CreditAttribution: bucefal91 commentedI definitely feel proud to announce that a feature request of 5 years old has been released as a part of stable Synonyms 7.x-1.5 release :) https://www.drupal.org/node/2720481
hehe, thank you, everybody for your patience.