D7: Add proper redirects for changing aliases

Created on 13 January 2024, 5 months ago
Updated 21 January 2024, 5 months ago

Problem/Motivation

Noticed this when testing

✨ D7: Add node/[nid] redirects automatically Needs work

When you change the entity alias, you don't get proper redirects.

Steps to reproduce

  • Install Drupal 7
  • Enable and configure quant, quant_api, quant_redirect and redirect modules
  • Use devel_generate to generate content
  • Edit a node with an alias and change the path to anotheralias to create a redirect
  • Edit the node again and change the path to anotheralias2 to create another redirect
  • Go to /anotheralias and it should redirect you to /anotheralias2
  • Go to Seed tab (/admin/config/services/quant/seed)
  • Check Export nodes, Export redirects and Trigger the batch
  • Click Save and Queue button
  • Look at Quant Dashboard redirects
  • Result: There is no redirect for /anotheralias to redirect to the /anotheralias2 alias
  • Expected result: Redirect should be present and work
  • Proposed resolution

    When processing the redirects during the seed process, figure out the current alias and create a redirect from the old alias to the current one.

    Remaining tasks

    1. Update code
    2. Review and test
    3. Commit :)

    User interface changes

    Redirects will work as expected.

    API changes

    Data model changes

    ✨ Feature request
    Status

    Fixed

    Version

    1.0

    Component

    Code

    Created by

    πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

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

    Comments & Activities

    Production build 0.69.0 2024