Linker does not appear for certain field widgets
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3548395. -->
Reported by: [wim leers](https://www.drupal.org/user/99777)
Related to !133 !132
>>>
<h3 id="overview">Overview</h3>
<p>@hooroomoo reported image matching failing at <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3548292" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3548292</a></span>.</p>
<p>@Wim Leers investigated and confirmed this is the case for *optional* image fields, but not for *required* image fields: in that case, a match is found. See point 3 at <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3548292" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3548292</a></span>, which includes this screenshot proving it:<br>
<img width="400" src="https://www.drupal.org/files/issues/2025-09-24/Screenshot%202025-09-24%20at%2010.45.59%20AM.png"></p>
<h4>Steps to reproduce</h4>
<ol>
<li>Create new "required image" field on the article node type (field type: <code>image</code>, check the "Required field" checkbox)
</li><li>Create "article" <code>ContentTemplate</code> in Canvas
</li><li>Create an instance of the "Canvas test SDC with optional image and heading" component.
</li><li>Put breakpoint in <code>\Drupal\canvas\Plugin\Canvas\ComponentSource\GeneratedFieldExplicitInputUxComponentSourceBase::buildComponentInstanceForm()</code> at the spot in the screenshot above, conditionally on <code>$sdc_prop_name == 'image'</code> and confirm suggestions do exist despite the linker not appearing.
</li><li>Install the <code>sdc_test_all_props</code> module.
</li><li>Put a conditional breakpoint in the <code>elseif ($could_use_dynamic_prop_source) {</code> branch of <code>GeneratedFieldExplicitInputUxComponentSourceBase::buildComponentInstanceForm()</code>
</li><li>Disable Xdebug for a moment
</li><li>Place the <code>all-props</code> SDC in the component tree for a <code>ContentTemplate</code>, now you can see the results
</li><li>Enable Xdebug, and repeat the request to <code>…/component-instance-form/…</code>
</li><li>Now check every time that the conditional breakpoint is hit whether the prop linker shows up. For the above (and more), it does not.
</li></ol>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p>TBD</p>
<h3 id="ui-changes">User interface changes</h3>
<dl>
<dt>Before</dt>
<dd>The prop linker is absent from the <q>Image</q> prop's media library widget:<br>
<img width="300" src="https://www.drupal.org/files/issues/2025-09-24/Screenshot%202025-09-24%20at%2011.12.50%20AM.png"><br>
(Note how the "prop linker" is present for the <q>Heading</q> prop.<br>
</dd>
<dt>After</dt>
<dd>TODO: The linker now does appear.</dd>
</dl>
> Related issue: [Issue #3548292](https://www.drupal.org/node/3548292)
> Related issue: [Issue #3541037](https://www.drupal.org/node/3541037)
> Related issue: [Issue #3541000](https://www.drupal.org/node/3541000)
issue