Not possible to multiple have bundle specific patterns for the same entity type

Created on 28 January 2025, 28 days ago

Problem/Motivation

With the current version of the module it is not possible to have multiple bundle specific patterns for the same entity type.

For example, in our project, we need a specific pattern for node type TypeA and another pattern for all other node types.
The current code in \Drupal\entity_reference_patterns\EntityReferencePatternMatcher::getMatches selects always the last pattern for the content type by weight. So it is not possible to have two different patterns for the same content type, that only differs by the selectable bundles.

I created a patch, which reworked EntityReferencePatternMatcher::getMatches a little bit so it allows the use case above.

I created that issue, cause maybe others have the same need and could use that patch.

After applying the patch it will use the first pattern, that matches entity type and bundle as configured in the patterns.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇭Switzerland megadesk3000

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024