Calculating dependencies of `ReferenceField(Type)PropExpression` is missing intermediate dependencies
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3544604. -->
Reported by: [penyaskito](https://www.drupal.org/user/959536)
Related to !130 !23
>>>
<h3 id="overview">Overview</h3>
<p><em>Surfaced in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3534561" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3534561</a></span>.</em></p>
<p>Calculating dependencies is not calculating properly the intermediate dependencies. It only includes "both ends".</p>
<p>E.g. if a component instance depends on a media which depends on a file, we are not getting the right dependencies: "media" dependencies are missing.</p>
<p>See attached failing functional test.</p>
<p>This is a bug that landed in <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3457504" title="Status: Closed (fixed)">#3457504: XB field type: calculate all dependencies, store them, surface in new Component "Audit" operation</a></span> and went unnoticed.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p>Expand test expectations in kernel tests, but keep the new functional test.</p>
<h3 id="ui-changes">User interface changes</h3>
<p>None. (Other than the implicit consequence: more complete config dependencies means there's more modules/themes whose uninstallation and config whose deletion will be prevented. 👍 That's why this is tagged <q>data integrity</q>.)</p>
> Related issue: [Issue #3457504](https://www.drupal.org/node/3457504)
issue