Closed (fixed)
Project:
Synonyms
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Apr 2015 at 08:36 UTC
Updated:
20 Oct 2015 at 08:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mrded commentedComment #2
mrded commentedComment #3
AlexKirienko commentedWith patch #2 two error messages occurred on save term without synonym:
Fixed patch with interdiff.
Comment #4
AlexKirienko commentedComment #5
bucefal91 commentedhello!
You're very right about the function synonyms_get_term_by_synonym() being slow. I looked into the patch from #3 - you take the approach that I support (and any other clever programmer would too), you leverage DB for the search operation instead of letting PHP do the string search. But the patch is not ideal.
Since we have this abstract field independency feature in Synonyms module, we just do not know how the field stores (encodes) the synonyms in the DB. Your patch would work for the text field type, but it wouldn't for entityreference, for example, because the latter has different columns in its field, i.e. it encodes data in another way in the DB.
Before the end of the next week I'll extend your patch to work with any kind of field types.
Comment #6
bucefal91 commentedI have coded what I outlined in my previous comment. Please, review it. I've updated the synonyms_get_term_by_synonym() and updated the synonyms extractor interface. Then I also updated the tests to cover the new functionality. Lastly, I reorganized the tests so now they are executed faster.
Comment #7
devad commentedHi
I don't know about speed improvments, but I have tested the patch and it applies nicely and as much as I have tested it didn't break any existing functionality causing new issues. Which is good. :)
Comment #8
mrded commentedHi guys,
The patch #6 has to many changes, it's really hard to review. @bucefal91, can you please do your refactoring as a separate issue?
Thanks.
Comment #10
bucefal91 commentedRefactoring was done only within synonyms.test file, the rest of the patch is fully tied to this issue. As the patch has been there for over 2 weeks and we have at least 2 people supporting it (myself and devad), I've committed it into the module code.
Comment #11
mrded commentedGreat, thanks! I've been using #3 patch for 6 months already, no problems so far.