Open avpaderno opened 1 year ago
I checked some functions/methods calling url()
, but none of them sets 'entity_type'
or 'entity'
. It seems the documentation comment has been copied from Drupal 7 without changing it when the code has been changed. In fact, in Drupal 7, entity_uri()
sets those values.
// Pass the entity data to url() so that alter functions do not need to
// lookup this entity again.
$uri['options']['entity_type'] = $entity_type;
$uri['options']['entity'] = $entity;
return $uri;
That code does not exist in Backdrop core.
(At least this PR passes the phpcs
tests.)
I tagged this issue with type - documentation
, since the task is changing a documentation comment for a function. I am not sure the tag is used also for those documentation comments. I think it is, since documentation comments are the source of the API documentation.
The documentation for
url()
says that$options
can contain these values:url()
. Only set ifurl()
is invoked byentity_uri()
.url()
is invoked byentity_uri()
.entity_uri()
does not callurl()
; any core method that implementsEntityInterface::uri()
does not return those values.The current documentation comment is the same used in Drupal 7, but in Drupal 7
'entity_type'
and'entity'
are effectively set fromentity_uri()
.That code does not exist in Backdrop core, in any function or method.
The documentation for
url()
should not document those values, since they are not used byurl()
nor any other function/method.