In edit mode, Dynamic Content Macros do not render correctly when they have the same parameter values

When more than one macro is inserted onto a Confluence page with the same parameter data, only the first macro will render with its expected body content. The sample macro listed below includes no parameters as this is the simplest way to reproduce the same behaviour.

Reproduction steps:

  1. Create a basic connect app which includes the following dynamic content macro:
{
"key": "bananamacro",
"name": {
"value": "Banana" 
},
"url": "/macro/banana.html",
"description": {
"value": "Yellow banana" 
},
"outputType": "block",
"bodyType": "none"
}
  1. Use the following html for banana.html:
<!DOCTYPE html>
<html>
<head>
<!-- HEAD -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-control" content="no-cache,no-store">
<title>Banana</title>
<script src="https://connect-cdn.atl-paas.net/all.js" type="text/javascript"></script>
</head>
<body>
<p id="banana-container" class="inline-paragraph">
Loading...
</p>
</body>
</html>
  1. Install the app
  2. Edit a confluence page and insert the macro twice
  3. Without publishing, observe the result while still in edit mode

Expected Result
Both macros render normally

Actual Result
The first macro renders normally, while any subsequent macros appear broken with no body (see screenshot)

screenshot1

Inspecting the page elements, I believe this could be perhaps related to Confluence assigning the same id to the divs which contain the iframe (see screenshot)

After publishing the page and observing the macros in view mode, these ids are different and the macros render as expected.

2 Likes

I believe this ticket is aimed at the same issue [CONFCLOUD-71192] When copying and pasting a Connect macro in the page editor, the pasted macro does not render a preview correctly - Create and track feature requests for Atlassian products.

2 Likes