Convert patch to MR.
1 unresolved thread
1 unresolved thread
Compare changes
@@ -53,6 +53,18 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager) {
'Defining a \'%s\' route requirement without a bundle for an entity type which has bundles (%s) is deprecated in drupal:11.2.0 and will be disallowed in drupal:12.0.0. Specify a bundle, either as a string or as a route parameter placeholder, in the route requirement. See https://www.drupal.org/node/3505093',
@thomas.fleming Why you checked for
$this->entityTypeManager->getDefinition()
not returning NULL? Since the optional parameter$exception_on_invalid
is TRUE by default, an exception will be thrown in that case. A null pointer will never happen.Hey @vidorado probably irrelevant at this point, and apologize for not including better info on my reasoning for this. IIRC I added this check to ensure that the more helpful exception in EntityCreateAccessCheck was thrown when the replication steps were followed. Otherwise, you get the plugin not found exception, which seems out of context given the replication steps.
Hi @thomas.fleming!
This is the modified code snippet:
All you added is a local var
$entity_type_definition
in order to be able to check it just in the if() below. But, as I see,$entity_type_definition
will never be falsy at this point, since$this->entityTypeManager->getDefinition($entity_type)
will throw aPluginNotFoundException
exception if the$entity_type
is invalid.As I see, you guard won't prevent
PluginNotFoundException
to be thrown, so I believe this change is not neccessary.Do you agree with me, and don't mind if I revert it, in that case?
Thanks in advance!