This issue has been created
There are 2 updates.
 
 
XWiki Rendering / cid:jira-generated-image-avatar-8aa781c3-11a0-4317-9007-317761a88765 XRENDERING-787 Open

MacroManager#exists is not consistent with the behaviour of MacroManager#getMacro

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-82a3e49f-8917-49fc-be5c-aac99f0a3853 Simon Urli created this issue on 21/May/25 14:03
 
Summary: MacroManager#exists is not consistent with the behaviour of MacroManager#getMacro
Issue Type: cid:jira-generated-image-avatar-8aa781c3-11a0-4317-9007-317761a88765 Bug
Affects Versions: 17.3.0
Assignee: Unassigned
Components: Transformation
Created: 21/May/25 14:03
Priority: cid:jira-generated-image-static-major-2632f8d1-0371-443f-8b6b-b2c406659add Major
Reporter: Simon Urli
Description:

MacroManager#getMacro always try to fallback on searching for the macro name without the syntax, while exists only check the given macro id, with the syntax exists.
IMO if MacroManager#exists returns false then MacroManager#getMacro with same id shouldn't return anything.

I propose to fix that by providing a new MacroManager#exists method with a boolean flag to avoid any breakage.

 
 

2 updates

 
cid:jira-generated-image-avatar-82a3e49f-8917-49fc-be5c-aac99f0a3853 Changes by Simon Urli on 21/May/25 14:03
 
Fix Version: 17.5.0-rc-1
Assignee: Simon Urli