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.
This patch adds checkbox to the entity_from_field relationship form to reverse field items, allowing the highest delta to be selected. This is similar to how views 3 handles multiple value fields.
This patch may also begin to help with http://drupal.org/node/1420446 although it does not provide display settings for the field at all.
Note: I had to add a submit handler for the ctools_entity_from_field_edit_form - there is probably a better way to save the new value but I could not find the appropriate submit handler.
Comment | File | Size | Author |
---|---|---|---|
entity_from_field.inc_.patch | 2.16 KB | johnnybgoode |
Comments
Comment #1
uripo CreditAttribution: uripo commentedI applied your patch, but I don't see any checkbox in the Views relationships dialog.
Is it maybe I missed something I'm supposed to do after applying the patch?
Or... perhaps I misunderstood something and so I'm looking in the wrong place?
Comment #2
johnnybgoode CreditAttribution: johnnybgoode commentedThis patch has nothing to do with Views or views relationships, it only provides functionality similar to how Views handles multiple value fields.
This patch will add a checkbox to the settings form for an 'entity from field' relationship in the panels page manager to allow the entities referenced by the possibly multiple value field to be reversed when returned to panels as contexts. This then allows the user to easily select the last entity referenced by a multiple value field, e.g. the deepest taxonomy term selected in a term reference field.
Hope that clears things up.
Comment #3
jonhattanWorks as expected.
I guess we need a 8.x version first btw.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedThe patch fails code style:
That's simple enough to fix. But it also checks the new flag 'delta_reversed' without using empty() or isset() which means that existing panes that do not have that field set will cause notices. Other than that it looks okay.