- Merge request !169#3548761 do not evaluate dynamic prop sources in clientModelToInput → (Merged) created by tedbow
If you have a non-required prop and try to link it to an entity field that is empty on the entity being previewed, the linking
does not complete.
This appears to be because when the entity field is empty, it is removed from the $inputs
array returned by
\Drupal\canvas\Plugin\Canvas\ComponentSource\GeneratedFieldExplicitInputUxComponentSourceBase::getClientSideInfo
Which ultimately results in buildComponentInstanceForm
not being able to get the $source
value that would identify the prop as dynamic, because when this runs:
$source = $this->uncollapse($inputValues[$sdc_prop_name] ?? NULL, $sdc_prop_name);
There is no $inputValues[$sdc_prop_name]
because it was not included by the array returned by getClientSideInfo
See here for $evaluated = $source->evaluate($host_entity, $is_required_prop);
some xdebug demonstrating the null evaluated when the specified host entity field is empty.
$evaluated = $source->evaluate($host_entity, $is_required_prop);
will show you the place where the array-skipping NULL occurs. I'm sure the internals of $source->evaluate
will reveal more.Active
1.0
… to be triaged
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.