In entity_translation_overview() if there is a destination url parameter, any custom url parameters for the add/edit links are overwritten.
For example, I have a custom module that adds a query parameter when switching languages, which works fine unless there is a destination parameter on the translation overview page.
Expected Result
When on: /node/789/translate
The edit url is: /zh/node/789/edit/zh-hans?langswitch=zh-hans
When on: /node/789/translate?destination=admin/content
The edit url is: /zh/node/789/edit/zh-hans?langswitch=zh-hans&destination=admin/content
Actual Result
When on: /node/789/translate
The edit url is: /zh/node/789/edit/zh-hans?langswitch=zh-hans
When on: /node/789/translate?destination=admin/content
The edit url is: /zh/node/789/edit/zh-hans?destination=admin/content
Comment | File | Size | Author |
---|---|---|---|
#1 | entity_translation-dont-override-link-query-2204285-1.patch | 1.97 KB | jojonaloha |
Comments
Comment #1
jojonaloha CreditAttribution: jojonaloha commentedAttached patch sets $link['query'] to an empty array if it isn't set already before using += to extend the array and add the destination parameter.
Comment #2
stefanos.petrakis@gmail.comHello there,
I just tested this, here are some points:
+ Applies cleanly, on a D7.50 against ET 7.x-1.x-dev
+ Patch looks fine and makes sense.
+ I would need some more info to reproduce the described problem and confirm that the patch solves it. Best would be some code snippet, as close as possible to the one that gave you the problem in the first place. Tried using a hook_url_outbound_alter implementation, but that didn't produce the problem described.
Setting this to postponed for the time, following from the 3. point above.
Comment #3
plachEven better would be a failing test, although all tests are failing now (I'll try to fix that ASAP :)