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.
Problem/Motivation
The NameItem field item class does not override mainPropertyName() and thus returns 'value'. 'value' does not respond to a property on name field items so any code that makes use of getMainPropertyName() breaks or gives incorrect results.
One example of this is in CTools TypedDataRelationshipDeriver:
if ($main_property = $property_definition->getFieldStorageDefinition()->getMainPropertyName()) {
if ($property_definition->getFieldStorageDefinition()->getPropertyDefinition($main_property)) {
Solution
Correctly override mainPropertyName to return NULL
Comment | File | Size | Author |
---|---|---|---|
#2 | 3054937-2.patch | 510 bytes | rlmumford |
Comments
Comment #2
rlmumfordPatch does as stated in the issue summary
Comment #3
rlmumfordComment #5
rlmumfordComment #7
rlmumfordFailures do not seem to be related to the patch?
Comment #8
rlmumfordComment #10
Alan D. CreditAttribution: Alan D. commentedCorrect
Pushed though, cheers