Problem/Motivation
Recently I found similar bug to this one #2325463: Destination URL breaks preview,
Stepts to reproduce:
- Make some CT translatable, add a couple languages, add some node and translate it into other language.
- Then when you're, let's say, on /af/node/1/translations/add/en/af, add to a url destination param, so your param might looks like
/af/node/1/translations/add/en/af?destination=/node
- Then in the "SOURCE LANGUAGE: ENGLISH" fieldset select another language (Ukrainian), click "Change" button
Expected results:
- I'm staying on the add node translation page
- Url should be changed to the /af/node/1/translations/add/uk/af?destination=/node
- I should see message on the page "Source language set to: Ukrainian"
- After adding a translation, system should redirect me to the url that I set in destination query parameter
Current behavior
- System redirects to the /node page and all my inputs are lost
- I see message on the page "Source language set to: Ukrainian"
Proposed resolution
- Set destination query to the form state redirect
Remaining tasks
- Write a CR?
- Review patch and commit it
User interface changes
- None
API changes
- None
Data model changes
- None
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #41 | 2954032-41.patch | 7.23 KB | ranjith_kumar_k_u |
| #33 | interdiff_29_33.txt | 2.6 KB | spokje |
| #33 | 2954032-33.patch | 7.16 KB | spokje |
Comments
Comment #2
vlad.dancerComment #3
vlad.dancerHere is added test without fix to prove the problem.
Comment #4
vlad.dancerUpdate issue description.
Comment #6
vlad.dancerOk, here is a combined patch - test + fix.
Comment #8
vlad.dancerAdd base url.
Comment #11
matsbla commentedComment #14
matsbla commentedComment #15
matsbla commentedComment #16
matsbla commentedComment #17
matsbla commentedComment #18
matsbla commentedComment #19
jungleThanks, @matsbla!
Needs a CR? Make it optional for BC.
Start with a verb "Test" -> "Tests"
t()calls should be avoided in tests where possible.Comment #20
jungleApplying IS template
Comment #21
matsbla commentedComment #22
matsbla commentedComment #23
matsbla commentedComment #24
matsbla commentedNot sure if CR is needed as the new construct parameter is optional, doesn't look like CR was created other places where new optional parameters where introduced. Put back to NR to get feedback from a core committer.
Comment #25
matsbla commented@jungle
Thanks for the review!
Comment #26
jungleWrong indentation. the
}line.Missing the summary/comment.
Prefer removing extra whitespaces before
=, but your way is allowed by coding standard.Otherwise, besides the CR, it's good to me. Thanks!
Note: attaching a test-only patch would be better.
Comment #27
jungleComment #28
matsbla commentedThank you!
Comment #29
matsbla commentedComment #30
matsbla commentedComment #32
larowlanLooking good, couple of observations/suggestions
This will need a trigger_error for BC sake to notify of the deprecation for D10
We could use assertStringContainsString here instead and then the $message isn't needed
Comment #33
spokje1. Added draft CR: #3189305: \Drupal\content_translation\ContentTranslationHandler constructor adds $request_stack argument.
2. Reroll against
9.2.xincluding fixing deprecations3. Addressed both points in #32 in attached patch.
Comment #34
gauravvvv commentedPatch applied cleanly. Moving to RTBC.
Comment #35
gauravvvv commentedComment #36
gauravvvv commentedComment #37
gauravvvv commentedComment #41
ranjith_kumar_k_u commentedRerolled #33.
Comment #42
gauravvvv commentedComment #44
smustgrave commentedCI Failure.