[MAGNOLIA-8855] Page is not available via full JCR path if handlePrefix has more than 1 level Created: 24/Mar/23 Updated: 11/Apr/23 Resolved: 11/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: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| 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 |