- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
I guess the issue is within this method:
function comment_fragment_entity_type_alter(array &$entity_types) { /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */ $entity_types['comment']->setUriCallback('comment_fragment_uri'); $links = $entity_types['comment']->get('links'); unset($links['canonical']); $entity_types['comment']->set('links', $links); }
in the .module file.
The content of $links is:
array(5) { ["canonical"]=> string(18) "/comment/{comment}" ["delete-form"]=> string(25) "/comment/{comment}/delete" ["delete-multiple-form"]=> string(29) "/admin/content/comment/delete" ["edit-form"]=> string(23) "/comment/{comment}/edit" ["create"]=> string(8) "/comment" }
so I guess by unsetting
["canonical"]
this just returns the next available item from the array?What is this expected to do instead?
- Status changed to Needs review
5 months ago 4:20pm 17 June 2024 - 🇩🇪Germany Anybody Porta Westfalica
Okay I think I found the expected and more robus implementation, please take a look at the MR.
For me it works as expected now! :) Thank you! - 🇩🇪Germany Anybody Porta Westfalica
Static patch attached until we have a new release!
- First commit to issue fork.
-
fjgarlin →
committed d0cd41e0 on 1.x
Issue #3455106 by Anybody: Permalink now points to comment/XYZ/edit
-
fjgarlin →
committed d0cd41e0 on 1.x
- Status changed to Fixed
5 months ago 7:11am 18 June 2024 - 🇪🇸Spain fjgarlin
Makes sense. Thanks for the details at comment #2. They're really helpful in understanding the issue.
- 🇩🇪Germany Anybody Porta Westfalica
Thank you for the super quick fix @fjgarlin!!
Could you tag a new release perhaps? Automatically closed - issue fixed for 2 weeks with no activity.