Ask users to create redirects in the node delete process

Created on 21 January 2025, 3 months ago

Problem/Motivation

Content editors usually forget to create redirects of the deleted content, and it falls in a 404 errors increase.

Suggested Resolution

sub-module.
Create a sub-module that, once enabled, will allow the user to create redirects for the deleted node in the delete form.
The user will be able to create a redirect when the node is deleted in the original language.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇪🇸Spain frouco

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

Merge Requests

Comments & Activities

  • Issue created by @frouco
  • Pipeline finished with Success
    3 months ago
    Total: 677s
    #401723
  • 🇪🇸Spain frouco

    Editors are prompted to create a redirect on node delete.

    Ready to review.

  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 198s
    #403563
  • Pipeline finished with Success
    3 months ago
    #403573
  • 🇪🇸Spain lpeidro Madrid

    Additional checks have been added to ensure that the function _redirect_delete_helper__set_key_value_data() receives the correct values. There was a case where an error was generated due to passing a NULL value when a node search was performed to create the redirect, but the node was subsequently deleted, leaving the field empty.

  • Assigned to antonio.nunez
  • Status changed to Needs work 10 days ago
  • 🇪🇸Spain antonio.nunez Spain

    A new setting will be added to decide if the redirection to another node will be mandatory. Depending on the use case, the form will be displayed in one way or another.

  • 🇪🇸Spain antonio.nunez Spain

    A new tab has been added in the Redirect module configuration to allow defining, using a checkbox, whether the redirection of nodes when deleting them should be mandatory or not. The form will continue to be modified to adapt the behavior to this configuration.

  • Pipeline finished with Success
    10 days ago
    Total: 253s
    #475197
  • 🇪🇸Spain antonio.nunez Spain

    The logic has been completed so that the redirection field is mandatory when deleting a node, in case the corresponding option is enabled in the module configuration. In this way, the behavior of the form is dynamically adjusted as defined by the administrator.

  • Pipeline finished with Success
    10 days ago
    #475210
  • 🇪🇸Spain lpeidro Madrid

    Hello Antonio:

    Just I did some small changes:
    - Added settings schema and default value.
    - If the redirect is required, we don't need to show the checkbox.

    It works as expected.

    Thank you very much.

  • Pipeline finished with Success
    4 days ago
    Total: 193s
    #479381
  • 🇪🇸Spain lpeidro Madrid

    It would be great if a message were displayed when a node is deleted and a redirection occurs. Currently, the user is only informed that the node was deleted, but not that they have been redirected.

  • Pipeline finished with Failed
    about 13 hours ago
    Total: 268s
    #482195
  • 🇪🇸Spain lpeidro Madrid

    The functionality to enforce redirection is excellent; however, it currently applies to all content types. In some cases, certain content types are not used as full pages but rather as components. Therefore, it would be helpful to configure when this functionality should be applied.
    To address this, I propose adding a form that allows us to select the applicable content types.

Production build 0.71.5 2024