When viewing redirects in the "Redirect URL" view (/admin/config/search/redirect) The urls in the From and To columns are not decoded. This leads to very hard to read urls when they contain non latin characters.
How to replicate
1. Add a redirect rule containing non latin characters, for example set path to: /会社概要/イベントン and
2. Check the added redirect on /admin/config/search/redirect
Expected behaviour
The text in the from column should read /会社概要/イベントン
Actual behaviour
The text in the from coulmn reads /%E4%BC%9A%E7%A4%BE%E6%A6%82%E8%A6%81/%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%83%B3
Proposed fix
Adding urldecode() to the RedirectSourceFormatter should fix the output in the From column.
Fixing the To column cannot be done in this module since the column uses the LinkFormatter defined in core.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | admin_config_search_redirect.png | 29.92 KB | rahul.nahar001 |
| #5 | Redirect Drupal8.png | 71.86 KB | dinesh18 |
| #4 | admin_config_search_redirect.png | 36.74 KB | rahul.nahar001 |
| #2 | 2869055.patch | 580 bytes | reekris |
Comments
Comment #2
reekris commentedHere is patch that adds
urldecode()as proposed.Comment #3
berdirMakes sense, any change you can write a test for this?
Comment #4
rahul.nahar001 commentedHi @reekris,
I have checked above mentioned steps this patch not working for me.
Expected behavior does not come after applied the provided patch.
PFA.
Thanks
Rahul
Comment #5
dinesh18 commentedHello,
We need to execute the code again by saving the same URL re-direct. PFA screenshot and it is working as expected.
Thanks,
Dinesh.K
Comment #6
dinesh18 commentedStatus changed to Needs Review.
@Rahul Could you please test at your end as well.
Comment #7
rahul.nahar001 commentedHi @Dinesh18,
The "To" URL is not showing as expected. PFA.
Thanks
Rahul Nahar
Comment #8
rahul.nahar001 commentedStatus changed to Need Work.
Comment #9
dinesh18 commentedAs per the proposed resolution, To column cannot be done in this module.
Comment #10
rahul.nahar001 commentedSorry, I missed it.
So for "FROM" column, it is working as expected.
Comment #11
berdirWe should probably open a core issue so this can be done in the core formatter as well.
Comment #12
berdir#2904853: Use rawurldecode() in LinkFormatter to correctly display encoded URLs.
Manually tested and committed.