Problem/Motivation

Right now EntityReferenceItem hardcodes dependencies from the DefaultSelection selection handler. Concretely, is using the DefaultSelection handler target_bundles to build a list of dependencies, regardless of what effective handler is used by that field. But there are other selection handlers not extending DefaultSelection, like ViewsSelection (or even custom selection handlers) that have no target_bundles setting (that belongs only to DefaultSelection). Those selection handlers are exposing other settings that are creating dependencies. Such dependencies are ignored when EntityReferenceItem calculates the field configuration dependencies. For example an entity reference field that uses a ViewsSelection selection handler should depend on the view that is configured in the field configuration. But right now in HEAD is not adding that view as dependency.

Proposed resolution

Copy ERItem changes to DERItem once #2786841: Entity reference fields should add selection handler config dependencies is fixed.

Remaining tasks

#2786841: Entity reference fields should add selection handler config dependencies

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jibran’s picture

jibran’s picture

Status: Active » Needs review
jibran’s picture

Title: Add DERItem::onDependencyRemoval » Add tests for DERItem::onDependencyRemoval

Added the function in 27bc319 only needs tests now.

jibran’s picture

jibran’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
jibran’s picture

Issue tags: +ER feature parity
jibran’s picture

Title: Add tests for DERItem::onDependencyRemoval » DER fields should add selection handler config dependencies
Issue summary: View changes
Related issues: +#2786841: Entity reference fields should add selection handler config dependencies

The original issue is fixed in #2766187-34: Allow config entity references thanks to @jhedstrom. Let's rescope this issue to fix core ER issue #2786841: Entity reference fields should add selection handler config dependencies.

jibran’s picture

Status: Needs review » Active