Redirect to layout builder breaks with aliased nodes

Created on 5 April 2023, about 1 year ago

Problem/Motivation

This module includes an option to redirect to the layout builder interface. This redirect is build from the URI following the format `'internal:' . $entity->toUrl()->toString() . '/layout'`. This path is not valid valid for nodes that have an alias. Appending `/layout` will likely generate a 404 response.

Steps to reproduce

* Enable the entity_redirect module
* Navigate to the setting page of a content type, for example a 'Page' node. admin/structure/types/manage/page
* Click on the 'Publishing Options' tab and find the 'Redirect after Entity Operations'
* Set the 'Add' redirect to be 'Enabled' with the 'Redirect Destination' of 'Go to Layout Builder Page'.
* Save the content type settings.
* Create a new page node. node/add/page
* Populate the node with any content. Make sure to set an alias such as 'my-awesome-page'
* Save the node.
* The author is redirected to 'my-awesome-page/layout' and the browser receives a 404 error.

Proposed resolution

Change the redirect destination to use the default layout builder route. This is not a comprehensive solution but will work for any sites using the out of the box layout builder functionality.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nJim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @nJim
  • @njim opened merge request.
Production build 0.69.0 2024