Redirect gracefully when translation already exists#1002
Open
Conversation
Instead of a WSOD, redirect to the translation overview with a warning when a user tries to add a translation that already exists. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
Is this a Drupal core bug? If so, can we create an MR? |
Collaborator
Author
|
@amitaibu I think it comes from Core yeah. The fix in core may take months to make it in though 😅 |
Collaborator
Author
|
@amitaibu what would the TB be for the core fix? is ~2h good? |
Member
Indeed. But I suspect we might already have an existing MR for this, we can't be the first ones.
Exactly. If no existing issue found (please check on a clean Drupal installation) |
Collaborator
Author
|
@amitaibu if there's an MR/Patch already existing, how would you like to proceed? Patch DS for now? Or just leave it? |
Member
|
Likely patch DS |
Collaborator
Author
|
Found the core issue: https://www.drupal.org/project/drupal/issues/2137815 I'll patch DS and revert this. |
This reverts commit a27b109.
Apply d.o. #2137815 patch to ContentTranslationController to redirect to the translation overview instead of throwing an exception when a user tries to add a translation that already exists. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
TB: 0.5 / 2h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
composer.patches.jsonContentTranslationController::add()when the target translation already exists, preventing an uncaughtInvalidArgumentException(WSOD)ServerGeneralTranslatorTestto verify the redirect behaviorTest plan
/node/[nid]/translations/add/en/[langcode]for a node that already has a translation in that language/node/[nid]/translationsddev phpunit --filter testRedirectWhenTranslationAlreadyExists🤖 Generated with Claude Code