Posted by johnnybgoode on July 26, 2012 at 6:22pm
4 followers
Jump to:
| Project: | Chaos tool suite (ctools) |
| Version: | 7.x-1.x-dev |
| Component: | Plugins system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
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.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| entity_from_field.inc_.patch | 2.16 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 24 pass(es). | View details | Re-test |
Comments
#1
I 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?
#2
This 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.
#3
Works as expected.
I guess we need a 8.x version first btw.
#4
The patch fails code style:
<?phpif ($foo) { ... }
?>
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.