Allow to disable redirecting after entity save

Created on 23 November 2023, 7 months ago

Problem/Motivation

In πŸ“Œ Use another approach to avoid 403/404 pages on entity save Fixed a redirect is created on content entity save which redirects back to the edit form. Presumably to prevent users seeing the rabbit hole behaviour which can be anything since it is a pluggable system.

IMO the module is a bit too opiniated what should happen here, since people can create custom plugins with special behaviours or
even permission handling built in. In those cases, the default behaviour should be untouched.

I know there is a bypass permission, but that bypasses the entire behaviour, not just the redirect.

Steps to reproduce

Just configure a node type with a rabbit hole behaviour and save a node. You will be redirected back to to the edit form instead of the canonical.

Proposed resolution

Either remove this redirect feature, or make it optional. If optional it could be done through a global setting, a per content entity type setting, or permission.

Remaining tasks

Discuss preferred solution.

User interface changes

Depending on choice settings, or permissions.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands askibinski

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

Comments & Activities

  • Issue created by @askibinski
  • πŸ‡³πŸ‡±Netherlands askibinski
  • πŸ‡³πŸ‡±Netherlands askibinski

    For starters, here is a cleanup of the hook_form_alter which is hard to read in the current state and does a lot of different things. The messages are split up in their own specific form_id or base_form_id alters and can be removed in 3.x since they only show a message.

    The only thing remaining in the form alter is the redirect which checks on content entity interface which will prevent excuting unnecessary code on many other forms.

    But this will make further changes depending on choice easier.

  • πŸ‡ΊπŸ‡ΈUnited States seantwalsh Eatontown, NJ

    I ran into this issue today. I think it would be most flexible to have an option per entity type. For example we would get a checkbox on the settings for a node type "Disable redirect to edit on save" or something like that.

Production build 0.69.0 2024