Performance: replace field_read_instances() with field_info_instances()

Created on 26 August 2015, almost 9 years ago
Updated 3 October 2023, 9 months ago

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.

πŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland das-peter

Live updates comments and jobs are added and updated live.
  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
Production build 0.69.0 2024