-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Component/s: Macros - Other - 3rd Party
-
Minor
Issue Summary:
When using the getMacroContent() method on a Confluence Forge macro that was migrated from Connect, the method fails to retrieve the macro content if the page still contains the legacy Connect macro entry in structured-macro format. This happens because the method only searches for macro IDs inside ADF node blocks, causing it to fail for old-format macros that haven’t been manually converted.
Steps to Reproduce
1: Migrate a Connect macro to Forge.
2: Migrate an additional Connect macro module to a Forge macro module without editing the macro instance on the page (leaving it in the legacy structured-macro format).
3: Call getMacroContent() for the migrated macro.
Expected Results
The getMacroContent() method should return the macro content regardless of whether the macro instance is stored in ADF format or the legacy structured-macro format after migration.
Actual Results
The following exception is thrown in the console and xxxxxxx.log file:
App.js:11 Error getting macro content: n: Unable to get macro content: Failed to get macro: Error: getNodeWithPosByLocalId(): Could not find node with ID 'c011a348-2294-40d6-bd13-c52861d8e10f'. at t.getMacroContent (
In the storage format of the page, the macro ID is present in the legacy Connect macro entry:
<ac:structured-macro ac:name="cc-eco-test-macros-static-block-output" ac:schema-version="1" data-layout="default" ac:local-id="3f7510e1-0b06-47a8-b43c-48e4af6d9e44" ac:macro-id="c011a348-2294-40d6-bd13-c52861d8e10f" />
However, getMacroContent() only searches inside ADF blocks, so the ID is not found.
Workaround
1. Edit the page containing the legacy macro.
2. Remove the old macro entry.
3. Add the macro again.
4. Save the page.
This triggers the conversion to ADF format, allowing getMacroContent() to find it.
If the customer cannot manually edit the macro, there is currently no viable workaround.
- is cloned by
-
EXT-3724 Loading...