[PP-1] Add support for matching against multi-bundle reference fields (e.g. a media field referencing 2 media types of different MediaSource plugins)
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3563309. -->
Reported by: [f.mazeikis](https://www.drupal.org/user/3513671)
>>>
<h3 id="overview">Overview</h3>
<p><a href="https://www.drupal.org/project/canvas/issues/3550750" title="Adding bundles-specific expression branching support to `ReferenceFieldTypePropExpression`">#3550750</a> added branching support to <code>ReferenceFieldTypePropExpression</code>, which allows branching in static prop sources.</p>
<p>It will also add branching support to <code>ReferenceFieldPropExpression</code>, which is necessary for DynamicPropSource matching. </p>
<p>⚠️ That has <em>never</em> been supported, not even for multi-bundle expressions as they've been around previously. This was first diagnosed at <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3541361" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3541361</a></span>.</p>
<p>THIS issue will:</p>
<ol>
<li>update the shape matching logic to find matches for multi-bundle reference fields — note that for optional component props this MUST also match fields/field properties that exist only a subset of the possible bundles! (See @lauriii's #16.8)</li>
<li>need to update the Labeler to support <code>ReferenceFieldPropExpression</code>s with branches</li>
</ol>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p>TBD</p>
<h3 id="ui-changes">User interface changes</h3>
> Related issue: [Issue #3550750](https://www.drupal.org/node/3550750)
> Related issue: [Issue #3541361](https://www.drupal.org/node/3541361)
> Related issue: [Issue #3541000](https://www.drupal.org/node/3541000)
issue