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.
Straight out of the box, merging two or more terms results in the error in the title of this issue.
A simple fix is to wrap the function in a hasField() method, to ensure the getValue() method is running on a field that is present on the Entity in question.
Patch incoming :)
Comment | File | Size | Author |
---|---|---|---|
#6 | 3024238-6.patch | 3.04 KB | legolasbo |
| |||
#3 | fix-undefined-method-getvalues-on-null-3024238-3.patch | 493 bytes | stimalsina |
#2 | fix-undefined-method-getvalues-on-null-3024238-1.patch | 647 bytes | ChristianSanders |
Comments
Comment #2
ChristianSanders CreditAttribution: ChristianSanders at ComputerMinds commentedWorks with Alpha1 version of the module - since I can only select 1.x-dev the test will probably fail!
Comment #3
stimalsina CreditAttribution: stimalsina as a volunteer and at The Weather Company commentedHere is a slightly modified patch for the Alpha1 version. This allows to return early from the loop if an entity doesn't have a field, otherwise it can error at setValue.
Comment #4
legolasboLets see what testbot thinks about this
Comment #5
legolasboThe patch no longer applies because the functionality in question has been moved to the term_reference_change module in the latest dev version. Please update to the latest dev version and verify if this is still an issue for you then.
Comment #6
legolasboI've taken the time to write an integration test for this to see if the issue is still present and to prevent it from happening in the future. The test passes locally, so it seems like the issue is no longer present.
Comment #7
legolasbo