Display current langauge's redirects on node form

Created on 21 June 2023, over 1 year ago
Updated 14 June 2024, 6 months ago

Problem/Motivation

The node form's lists all redirects associated with the node regardless of the redirect's language configuration. When viewing a translation's node form, it appears there are duplicate redirects b/c all redirects are listed.

Steps to reproduce

  • Install and configure Redirect module with the Umami demo install profile
  • Create two redirects for an English translation, configure redirect language to be English
  • Edit Spanish translation of same node, view English redirects appear in list
  • Create redirect for Spanish translation, configure redirect langauge to be Spanish
  • Edit English translation, observe English and Spanish redirects appear in list

Proposed resolution

Here are few possible solutions

  • Update RedirectRepository::findByDestinationUri() to use current active language as a query condition always
  • Update RedirectRepository::findByDestinationUri() to accept language parameter, if provided add query condition; which will not change existing usage; update redirect_form_node_form_alter() to pass along current active language to RedirectRepository::findByDestinationUri()

Remaining tasks

  • Review proposed solutions and decided on one
  • Implement
  • Add tests

User interface changes

Changes how redirects are listed on node edit form

API changes

RedirectRepository::findByDestinationUri() returns language specific redirects

Data model changes

None

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States jasonawant New Orleans, USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024