Repository navigation
[6.x] Fix switching sites when creating a term - #15938
Merged
Merged
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-01a1e4ec-f841-7259-a38d-0451bf2a2ec5 Co-authored-by: Duncan McClean <duncan@duncanmcclean.com>
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.
This pull request fixes an issue where you couldn't switch sites when creating a term. This happened both on the term create page and in the stack opened from a Terms field.
This was happening because the term publish form treated the other site like a missing localization of an existing term, and tried to
POSTto{create url}/localize. That route only exists for saved terms, so it 404'd and nothing happened.This PR fixes it by loading the other site's create form in place. Unlike entries, which redirect to the other site's create URL, it does this without a redirect so the stack stays open over the entry you're editing.
This PR also keys the publish container by site, so the slug field remounts and continues generating from the title after switching.
Before
11884-before.mp4
After
11884-after.mp4
Fixes #11884
Amp thread: https://ampcode.com/threads/T-01a1e4ec-f841-7259-a38d-0451bf2a2ec5