- Issue created by @ericgsmith
file_get_file_references
has a parameter $field
which is described as:
@param \Drupal\Core\Field\FieldDefinitionInterface|null $field
(optional) A field definition to be used for this check. If given,
limits the reference check to the given field. Defaults to NULL.
When passing in a field definition the logic within the fuction is actually comparing this field to field storage definitions instead of the field instances.
Passing in a storage definition is not permitted by the type hint - but removing this type hint and passing in field storage instead of field config does return the correct response.
See patch
In #3035352 it is proposed to deprecate this function and move to a service.
I have looked through core and there are no usages on this param.
I have search in contrib and was unable to find any attempt to use a non NULL value for this param.
Rather than fix, it might be an option to just drop this param as part of #3035352
N/a
TBD
TBD
TBD
Active
11.0 🔥