Problem/Motivation

Using _node_operation_route causes Drupal to register the route as an admin route. This results in all libraries that are globally loaded for admin routes to load, like system.admin.css, etc. In my case this is causing both CSS and JavaScript issues.

Steps to reproduce

View a public preview page, and note the scripts and CSS files that are being loaded are for admin paths.

Proposed resolution

Do not use _node_operation_route for public_preview.preview_link because this is NOT an admin path.

Remaining tasks

Patch.

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#2 3189531-node-operation-route.patch384 bytesjacine

Comments

Jacine created an issue. See original summary.

jacine’s picture

Status: Active » Needs review
StatusFileSize
new384 bytes

Here is a patch to remove it.

guillaumeg’s picture

Thanks for the patch, it fixes an issue with Lazy module which does not work if we are on an admin route (https://git.drupalcode.org/project/lazy/-/blob/8.x-3.x/src/Lazy.php#L140)

It would be great to get this patch merged.

guillaumeg’s picture

Status: Needs review » Reviewed & tested by the community