Closed (fixed)
Project:
Term Merge
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Apr 2013 at 16:01 UTC
Updated:
9 Nov 2015 at 03:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
henrijs.seso commentedAnd here is patch.
Since I wished this patch to be clean and universal, Entity reference module needs patching.
There is core bug #1416506: Field schema foreign keys support is broken that will be ported to D7. Entity reference will then be able to fix it's
foreign keysissue. Meanwhile follow this issue #1969018: Field schema foreign keys is always hard-coded to 'node' despite target type not set to node entity type for further development.Comment #2
henrijs.seso commentedChanging title to more descriptive for linking in other queues.
Comment #3
bucefal91 commentedHello!
It is not difficult to notice you did a deep research on how to integrate Entity reference in the best way. I see the core issue is fixed. Do we still need to wait for the issue #1969018: Field schema foreign keys is always hard-coded to 'node' despite target type not set to node entity type to be fixed? Or your patch now can be applied to Term Merge module and it will be working without any extra patches?
Thank you very much for contributing back into the module. It is really touching when a module administrator sees that people are willing to make a module better.
Comment #4
n3uronick commentedThis patch works for me but it generates a lot of notices in watchdog for the fields which do not have foreign keys. Here is a small interdiff to fix this.
Comment #5
n3uronick commentedComment #6
mrdalesmith commentedI'm not getting any joy from this patch - does it need re-upping for the current dev version? Because after applying the other patches required here and following the instructions, line 313 on term_merge has
$fields = field_info_field_map();, which never returns the$v['foreign keys']required by the code, and the results variable seems to be using a $k variable that doesn't exist.Comment #7
bucefal91 commentedHello
Those patches are over a year ago, apparently the code has moved forward since then. There hasn't been much demand for this feature, so I didn't concentrate my effort on coding this functionality.
But if folks speak up and ask for this feature, I'll be happy to implement it (be it just adjusting those patches or writing it up from scratch).
Comment #8
mrdalesmith commentedEntity reference is a core module in D8, so I think more and more D7 sites are going to be utilising it to keep their upgrade path clean. I think it'd make ter merge much more useful if it updated taxonomy terms wherever they were used, so my vote is for updating and including.
Comment #9
MathieuMa commentedHere is an updated patch for the latest stable version.
Comment #10
mrdalesmith commentedHave applied the updated patch without problems, and seen the expected results.
Comment #11
vildoc commentedsome errors in watchdog
key() expects parameter 1 to be array, null given in term_merge_action()And node doesn't get new term.
Comment #12
Leeteq commentedComment #13
dasginganinjaDoes this patch still require each node with the entity references to be saved? If so, we have something along the order of 1000 nodes that use these term references and need to have their terms merged. Touching each node and saving would take a large amount of time and resources. Is there any way to automate the saving with VBO / Drush or a similar fashion?
Are the instructions at this point?
Thanks in advance!
Comment #14
andriuzss commentedI still getting empty 'foreign keys'
This will do a trick.
Comment #15
Leeteq commentedComment #16
mrdalesmith commentedHave noticed intermittent failure to merge terms. Patch in #14 seems to have fixed: I may have been premature in saying the previous one worked.
Comment #17
jennypanighetti commentedI applied patch #14 and it broke my Term Merging. Now when I try to merge a term, it stops at "Initializing" and times out.
I increased the max_execution_time to 3 minutes, and now it just stays at "Initializing" and does nothing.
Comment #18
henrijs.seso commented@MrDaleSmith, @jenstechs Did you patch Entityreference? See #1.
Comment #19
mrdalesmith commented@mansspams The core bug is now fixed: there's no need for the patch: re-saving the entity reference fields updates the information to be correct.
Comment #20
jennypanighetti commentedBut we shouldn't be expected to re-save 8,000+ nodes for this module to work.
I ended up writing my own script - search for nodes, update reference field taxonomy ID, save node - and ran it via drush scr. No problems there.
Comment #21
bucefal91 commentedHello!
Thanks for putting up the patches above in the issue. I have slightly taken it further from the last patch. In this patch it should not only work for entityreference fields, but pretty much for any field that correctly defines its "foreign keys" property. I've also fixed comments here and there.
Please, try it out. I was able to successfully merge both taxonomy_term_reference and entityreference fields with this patch. If everybody likes it, then I'll add simpletests to cover entityreference integration and and then I'll commit it into the module.
Comment #22
devad commentedI have tested it.
I have tryed to trick it various ways to cause misfunction - with no success.
I have also tested this patch with Synonyms module enabled since Term Merge and Synonyms work closely together.
The conclusion is: It works!
I think it's ok to declare this patch "tested by community".
Comment #23
bucefal91 commentedAwesome news! And devad, I am in debt for your support. Thank you for being willing to test all of these issues. I know it takes time and I am sure you have many other things to do in your free time.
The issue will require to code simpletests (automated unit tests) that cover this new feature, before we can merge it; so I mark it as 'needs work'.
Comment #25
bucefal91 commentedI've added the simpletests for the existing patch and then committed into the repository. Hooray! We finally got the entityreference support :)
Thank you to everybody for collaboration and making it happen :)