[MAGNOLIA-4504] Preview Button generate broken links on page titles with special chars (german umlaute - utf8 is enabled) Created: 03/Aug/12  Updated: 01/Jun/15  Resolved: 05/May/13

Status: Closed
Project: Magnolia
Component/s: i18n
Affects Version/s: 4.5.3
Fix Version/s: 4.5.9

Type: Bug Priority: Major
Reporter: Jochen Buchholz Assignee: Jan Haderka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Gentoo Linux, Gentoo Tomcat 7, Maven 3.0 project, Google Chromium Browser


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

The preview link is broken when I switch preview and edit mode and produce a HTTP Status 404.

I builded up a maven magnolia project described at http://dev.magnolia-cms.com/~gjoseph/dont-deploy-magnolia-deploy-your-project. I switch the magnolia version to 4.5.3 and enabled multilanguage and utf-8 described at http://documentation.magnolia-cms.com/technical-guide/i18n.html#Unicode

Everything works fine on normal pages. I rename a page on the first level to Geschäftsfelder and put a subpage Lösungen on it. Every link is rendered correct in editing mode and in preview mode when I stay on a normal page. When I select Geschäftsfelder in my horizontal menu, the link is rendered correct like this (copied link):
http://127.0.0.1:8080/blabla-webapp-1.0-SNAPSHOT/Start/Gesch%C3%A4ftsfelder.html
it looks like
http://127.0.0.1:8080/blabla-webapp-1.0-SNAPSHOT/Start/Geschäftsfelder.html
in the url field of the chromium browser.

When I click on the upper left preview button, I got a "HTTP Status 404 The requested resource () is not available." and the link looks like:
http://127.0.0.1:8080/blabla-webapp-1.0-SNAPSHOT/Start/Gesch%25C3%25A4ftsfelder.html?mgnlIntercept=PREVIEW&mgnlPreview=true&mgnlChannel=desktop
When I replace correct the link by hand
http://127.0.0.1:8080/blabla-webapp-1.0-SNAPSHOT/Start/Gesch%C3%A4ftsfelder.html?mgnlIntercept=PREVIEW&mgnlPreview=true&mgnlChannel=desktop
the link works.

When I switch back to edit mode, the link is also broken



 Comments   
Comment by Milan Divilek [ 03/Aug/12 ]

Reproduced also in 4.5.4 version.
Thanks for reporting issue Jochen. Added to 4.5.5 changelog.

Comment by Jan Haderka [ 05/May/13 ]

Occurs only on 4.5 branch. No need to port to master as affected class is not used in 5.0 anymore.

Issue is caused by URLBuilder encoding every url even when obtained for already encoded URL via Window.location.getUrlBuilder. Since preview should never modify the url no matter what it is and since GWT doesn't allow configuration of the encoding behaviour, the only option left is to force decoding after url is generated via builder.

Generated at Mon Feb 12 03:56:25 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.