[MAGNOLIA-8856] Page is not available via full JCR path if handlePrefix has more than 1 level Created: 24/Mar/23 Updated: 18/Apr/23 Resolved: 13/Apr/23 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 6.2.30 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Carlos Cantalapiedra | Assignee: | Oanh Thai Hoang |
| Resolution: | Not an issue | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 2d 2.5h | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| 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: | |||||||||||||
| Epic Link: | Support | ||||||||||||
| Team: | |||||||||||||
| Work Started: | |||||||||||||
| Description |
Issue descriptionFollowing page is reachable via the following 2 URLs with the handlePrefix set to /travel If the handlePrefix is changed to /travel/about, the second URL with the full path to the node returns a 404, as the handlePrefix is added to the URL. Link to the handlePrefix handlePrefix with /travel/about Works:[ https://travel-demo.magnolia-cms.com/company|https://travel-demo.magnolia-cms.com/company] The problem is in info.magnolia.cms.beans.config.URI2RepositoryMapping#getHandle, as only the part before the first "/" is compared with the handlePrefix and the following removal of the handlePrefix isn't done. Expected resultsThe page can be accessed through the full path https://travel-demo.magnolia-cms.com/travel/about/company Actual results404 error is shown at browser WorkaroundModify the getHandle() method within the URI2RepositoryMapping class to get the handle before first slash as follows: URI2RepositoryMapping#getHandle() [...] if (StringUtils.startswith(cleanedUri, StringUtils.prependIfMissing(handlePrefix, "/"))) { // We remove any occurrences of the handle prefix from given URI cleanedUri = StringUtils.removeStart(cleanedUri, handlePrefix); } Development notesN/A |
| Comments |
| Comment by Carlos Cantalapiedra [ 24/Mar/23 ] |
|
Support score: 5 (bug) + 2 (MIPA) + 5 (very common interest) + 5 (quick win) + 5 (latest major release) + 0 (no threat) + 0 (no blocker) = 22 |
| Comment by Jaroslav Simak [ 11/Apr/23 ] |
|
Thank you very much oanh.thai. I agree with you that this is not a bug, it is expected behavior when handlePrefix property is configured. |