Adding bundle-specific expression branching support to `ReferenceFieldTypePropExpression`
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3550750. --> Reported by: [vishalkhode](https://www.drupal.org/user/2439156) Related to !539 !400 !198 >>> <h3 id="overview">Overview</h3> <ul> <li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3530521" title="Status: Closed (fixed)">#3530521: Decouple image shape matching from the `image` MediaType: support matching multiple bundles of a single MediaSources (`image`)</a></span> introduced multi-bundle support for references, with different field names per bundle.</li> <li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3530533" title="Status: Closed (fixed)">#3530533: Support image shape matching against multiple bundles of multiple MediaSources (`image` + `oembed` + `acquia_dam_asset` + &hellip;)</a></span> expanded this with per-bundle different field properties too.</li> </ul> <p>However, that's insufficient to meet all needs. </p> <p>The polymorphic nature is more complicated for videos than for images, because:</p> <ul> <li>reference to a core <code>\Drupal\media\Plugin\media\Source\VideoFile</code> media type's video media (let's say there's 2 such media types): something like<br> <pre>&#8505;&#65038;entity_reference&#9247;{src&#8605;entity&#9244;&#9244;entity:media:baby_videos|vacation_videos&#9245;field_media_video_file|field_media_video_file_1&#9246;&#9247;entity&#9244;&#9244;entity:file&#9245;uri&#9246;&#9247;url</pre></li><li>reference to an Acquia DAM video (<code>\Drupal\acquia_dam\Plugin\media\acquia_dam\Video</code>) media type, due to a different media source field, would need something like:<br> &#8505;&#65038;&#9244;entity:node:article&#9245;field_video_media&#9246;&#9247;entity&#9244;&#9244;entity:media:video&#9245;uri&#9246;&#9247;value <pre>&#8505;&#65038;entity_reference&#9247;{src&#8605;entity&#9244;&#9244;entity:media:acquia_dam_video_asset&#9245; acquia_dam_video_item&#9246;&#9247;src</pre></li><li>We then need to COMBINE these, to allow an entity reference that allows picking from both Drupal's <code>VideoFile</code> and Acquia DAM's <code>acquia_dam\Video</code>. This is impossible to express. </li></ul> <h3 id="proposed-resolution">Proposed resolution</h3> <p>Make it possible to express.</p> <h3 id="ui-changes">User interface changes</h3> <p>None.</p> > Related issue: [Issue #3483017](https://www.drupal.org/node/3483017) > Related issue: [Issue #3567249](https://www.drupal.org/node/3567249)
issue