Node Edit Redirect
This module corrects the URL when editing a translated node if Drupal falls back to a different language translation. It ensures the language prefix in the edit URL matches the language of the node being edited, preventing confusion when translations are missing.
This module fixes node edit URLs when Drupal falls back to an existing
translation because the requested translation does not exist yet.
When content language negotiation is based on the URL (prefix/domain), Drupal
normally redirects to the correct language prefix when editing an existing
translation. However, when a requested translation is missing, Drupal may fall
back to another translation while keeping the requested language in the URL.
This module redirects the edit form to the URL language that matches the
translation actually being edited.
Example
1. Content language is negotiated based on prefix. See also:
https://api.drupal.org/api/drupal/includes!language.inc/group/language_n...
2. When editing an English node while the prefix is French, the following redirect will happen:
/fr/node/3 => /en/node/3
The prefix language code now matches the language of the node.
Example use cases
- When relying on the "Current user's language" option from Views in the node
edit form, such as when using the entityreference_view_widget module.
- When using the i18n_select module, and term references/entity references
only show up if the referenced entities have the negotiated content language.
- When wanting to ensure that localized taxonomy terms appear in the same
language on the edit form as they do on the node.