Closed (fixed)
Project:
Lupus Custom Elements Renderer
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2021 at 08:23 UTC
Updated:
8 Dec 2022 at 10:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
aludescher commentedComment #3
aludescher commentedComment #4
fagoComment #5
fagothx, here a review
Weird, not nice to do all those special casing here for "node" - does this mean our metatag support would not work for otehr entity routes? I guess we should file a bug ticket and improve that in a separate ticket if so.
Comment #6
aludescher commented> it seems weird that the ::entityRevision() controller has to do magic to load parameters
Good point, I updated the controller.
> Weird, not nice to do all those special casing here for "node" - does this mean our metatag support would not work for other entity routes?
Yes, it seems so. Maybe it shouldn't even be addressed here but this change is needed to make node revisions work.
We could also add `entity.media.revision: path: '/media/{media}/revisions/{media_revision}/view'` and/or a new route for all entity types.
Comment #7
aludescher commentedComment #8
mostepaniukvmHi Anton,
Changes look good. It works for entity.node.revision route but I think we also need that for entity.node.latest_version route.
I don't really like to have node-specific implementation but let's finish it like that.
I created a follow-up issue so we can solve this problem there: #3304320: Re-implement node specific code to work with any entity types
Comment #9
aludescher commentedThanks Vova,
I added entity.node.latest_version.
Note: permissions 'view latest version', 'view any unpublished content' are still required for testing CE output.
Comment #10
aludescher commentedComment #11
mostepaniukvmPatch looks good, I will do manual testing soon
Comment #12
fagonot sure about this change, what does that do?
also those hunks seem to interfere with #3312042: Alternate-link meta tag is missing when using content translation, maybe let's merge the branch from there into this and re-roll the patch?
Comment #13
mostepaniukvmAs changes in #3312042: Alternate-link meta tag is missing when using content translation already merged we definitely need to re-roll the patch.
Meanwhile I tested and get api response fro both revision and latest revision routes. Paths: /api/node/*/latest, /api/node/*/revisions/*/view
What is unexpected that in both cases I got all the meta values but expected empty array.
> // The 'node' parameter is only a node id string for revision routes.
Are you sure that this is really true, or maybe it was changed in resent version of drupal?
In general it's not hurt a lot but if it's not really needed I wouldn't add that change.
Comment #14
fago> > // The 'node' parameter is only a node id string for revision routes.
not sure either, it depends on the route slug names used I suppose, if it uses "node" it's there and works.
I think we should follow traditional drupal behaviour here and only add all the metatags if drupal already does it like that, else we should not.
Comment #15
aludescher commentedRe-rolled without the (now) unnecessary 'node' parameter part.
Also changed return type of
CustomElementsMetatagsGeneratorTrait::setCeMetagasGenerator()from static to self in order to fix the following blocking error:`static` only works in PHP >= 8, see https://php.watch/versions/8.0/static-return-type
Drupal 9 requires PHP >=7.3.0 which should be supported unless we change the module to require PHP >= 8.
Comment #16
aludescher commentedComment #17
mostepaniukvmIt looks good now. Tested locally works correctly. I think we can merge it now.
Comment #18
fagogreat, merged then.