[MAGNOLIA-3884] cmsu:AHref always use default extension Created: 15/Nov/11  Updated: 11/Nov/15  Resolved: 11/Nov/15

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: 4.4.5
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Lauri Assignee: Fabrizio Giustina
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File ahref-extension-1.patch     Text File ahref-extension.patch    
Template:
Patch included:
Yes
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)
Date of First Response:

 Description   

cmsu:ahref works with default extension only. This might be incorrect behaviour.
See line 240 of AHref.java (4.4.5).

Extension output section is

AHref.java
if (MgnlContext.getHierarchyManager(ContentRepository.WEBSITE).isPage(path)) {
     out.print("."); //$NON-NLS-1$
     out.print(ServerConfiguration.getInstance().getDefaultExtension());
}

If site is running multiple extensions .getDefaultExtension() might be handicap. I.e. case when xml refers to another xml.

Suggested workaround is to add additional attribute to ahref tag which will enforce some particular extension, i.e. <cmsu:ahref .... extension="xml">link</cmsu:ahref>. See patch.

Patched AHref.java
                if (MgnlContext.getHierarchyManager(ContentRepository.WEBSITE).isPage(path)) {
                    out.print("."); //$NON-NLS-1$
                    out.print(extension == null ? ServerConfiguration.getInstance().getDefaultExtension() : extension);
                }

Forum link:
http://forum.magnolia-cms.com/forum/thread.html?threadId=16c4ec22-e94b-43e4-a1dd-fa6693544aba&page=1



 Comments   
Comment by Lauri [ 15/Nov/11 ]

P.s. somehow magnolia refuses to build here, so no test case provided.

Comment by Lauri [ 17/Nov/11 ]

ahref-extension-1.patch is the patch w/o code style changes.

Comment by Michael Mühlebach [ 11/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

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