Problem/Motivation

At the moment it is possible to end up in an infinite loop which causes a PHP memory exhaustion simply by selecting the wrong Destination Field. For example, if you have an inherited Description field, that field appears in the list of Destination Fields within the Description field inheritance configuration.

You therefore could use the Destination field as part of the inheritance to generate the Destination field... infinite loop.

Proposed resolution

Remove the current inherited field from the list of Destination fields.

And it might be worth checking there are no circular dependencies too. Field A has Field B as Destination Field, and Field B has Field A as Destination Field.

Command icon 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

owenbush created an issue. See original summary.

owenbush’s picture

Status: Active » Needs review

I have created an MR which resolves 2 things:

1. The current inherited field cannot be used as the destination field as that creates a circular dependency.
2. The default plugin is now only set once a source field is set, and will select the most relevant plugin rather than the default.

This patch can be used to test.
https://git.drupalcode.org/project/field_inheritance/-/merge_requests/1....

hot_sauce’s picture

Thank you owenbush, the new error checking appears to be working correctly as far as I can tell.

owenbush’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed reviewed & tested by hotsaucedesign

  • owenbush committed 295a13c on 2.0.x
    Issue #3238651 by owenbush, hotsaucedesign: Prevent Destination Field...

  • owenbush committed d91631c on 8.x-1.x
    Issue #3238651 by owenbush, hotsaucedesign: Prevent Destination Field...
owenbush’s picture

Status: Reviewed & tested by the community » Fixed

This has now been fixed, thanks to hotsaucedesign for the find and help testing.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.