Problem/Motivation
Currently the ctools relationship plugin (field_collection_field_collection_from_field_get_children()) uses field_read_instances() to determine the child plugins.
Unfortunately this function doesn't have a cache and since we use it in a pretty simple way we could fetch the same data using field_info_instances() which uses a cache if possible.
Proposed resolution
Change the processing to be able to use field_info_instances().
This also adds bundle independent plugins as proposed here: #2348995: Provide bundle independent ctools relationship plugin
Remaining tasks
Reviews needed.
User interface changes
None.
API changes
I've seen that the bundle independent plugin definitions still use the context_name of the first bundle specific plugin. Because of the switch to field_info_instances() the processing order of bundles might changes, leading to a different context_name for bundle independent plugin definitions.
However, using the same context name for bundle specific and bundle independent plugin definitions seems odd anyway. So I guess if something should be fixed it's the generation of the context name of bundle independent plugin definitions and not the processing order.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | field_collection-enhance-performance-of-ctools-relationships-2557835-3.patch | 4.22 KB | das-peter |
| #3 | interdiff-2557835-1-3-do-not-test.diff | 740 bytes | das-peter |
Issue fork field_collection-2557835
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
das-peter commentedOh, looks like the bundle independent plugins base on another patch from me :D
#2348995: Provide bundle independent ctools relationship plugin
Will provide an adjustment for the context name here.
Comment #3
das-peter commentedUpdated patch to set a dedicated context name for bundle independent plugin definitions.
Comment #4
chris matthews commentedThe patch in #3 does not apply to the latest 7.x-1.x-dev and may be too old to reroll, but I went ahead and tagged the issue accordingly.