The function metatag_get_route_entity()
is causing fatal error on my entity form since it calls Drupal::entityTypeManager()->getDefinition($entity_type);
without checking if the entity does exist.
My route name is mymodule.my_entity.add
and the module tries to get definition for mymodule.my_entity
entity. I am not sure what is the use of this method(I haven't look into the code that much), but I think that it should use route parameters instead of guessing.
Either try to get the entity object directly(if the entity route decorator has been applied) or try to match the parameter name with entity definition.
Comment | File | Size | Author |
---|---|---|---|
#7 | metatag-n2842092-7.patch | 2.59 KB | DamienMcKenna |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedivanjaros created an issue. See original summary.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #3
DamienMcKennaThe correct status for when you upload a patch file is "needs review".
Thanks for the patch, I'll take a look at this soon.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedYeah I know, I must have "overclicked" :)
Anyway, I wonder if there's a case when route does not have entity parameter set via entity decorator but metatags should be used?
Maybe scanning through the link templates in entity definitions could be a working approach...dunno.
Comment #6
DamienMcKennaThe patch didn't apply, if can you could please update the patch against the current -dev release so that we can run the tests, that'll help determine if this could be a possible solution.
Comment #7
DamienMcKennaLets see how the tests actually work.
Comment #9
DamienMcKennaThe tests are failing for other reasons, other patches are failing with the same errors.
Comment #10
DamienMcKennaCan you please test out the current -dev snapshot to see if the problem still exists?
Comment #11
DamienMcKennaI think this problem was solved elsewhere.