How can I update the number of macro input parameters on a macro without breaking all current places where the macro is being used?

I have a Confluence Cloud macro which had a single macro input parameter. I’ve since added 2 more macro input parameters to this macro.

For new instances of the macro, everything works just fine, but for existing instances, you cannot edit them at all.

On editing an instance of the macro, I get this “No macro metadata” modal rather than the proper edit modal:

How can I update the number of macro parameters on a macro without breaking all current places where the macro is being used?

More details of the problem are given here:

Also, having updated to the latest development version, then reverted to the version published on MPAC, the same “No macro metadata” screen is displayed. It’s like the new version pollutes the previous version.

For completeness, here’s the before and after for the macro definition:

Before

   "dynamicContentMacros": [
      {
        "url": "/smiles.html?data={smilesData}",
        "description": {
          "value": "SMILES Macro"
        },
        "icon": {
          "width": 90,
          "height": 90,
          "url": "/images/chemistry-toolkit/macro-icon.png"
        },
        "categories": ["confluence-content"],
        "outputType": "block",
        "bodyType": "none",
        "featured": true,
        "key": "SMILES-macro",
        "name": {
          "value": "SMILES Macro"
        },
        "parameters": [
          {
            "identifier": "smilesData",
            "name": {
              "value": "SMILES Text"
            },
            "description": {
              "value": "Add your SMILES format formula here"
            },
            "type": "string",
            "required": true
          }
        ]
      },
     ...
  ]

After:

   "dynamicContentMacros": [
      {
        "url": "/smiles.html?data={smilesData}&width={width}&height={height}",
        "description": {
          "value": "SMILES Macro"
        },
        "icon": {
          "width": 90,
          "height": 90,
          "url": "/images/chemistry-toolkit/macro-icon.png"
        },
        "categories": ["confluence-content"],
        "outputType": "block",
        "bodyType": "none",
        "featured": true,
        "key": "SMILES-macro",
        "name": {
          "value": "SMILES Macro"
        },
        "parameters": [
          {
            "identifier": "smilesData",
            "name": {
              "value": "SMILES Text"
            },
            "description": {
              "value": "Add your SMILES format formula here"
            },
            "type": "string",
            "required": true
          },
          {
            "identifier": "width",
            "name": {
              "value": "Width"
            },
            "description": {
              "value": "In pixels, as an integer e.g. 600"
            },
            "type": "string",
            "required": false
          },
          {
            "identifier": "height",
            "name": {
              "value": "Height"
            },
            "description": {
              "value": "In pixels, as an integer e.g. 600"
            },
            "type": "string",
            "required": false
          }
        ]
      },
     ...
  ]

Aside: Are Atlassian are running an unsupported version of Java for Confluence Cloud? :rofl:
https://confluence.atlassian.com/confkb/no-macro-metadata-errors-347341441.html

6 Likes

Now with added explainer video:

:slight_smile:

2 Likes

This is pretty concerning.

1 Like

@david thanks for sharing. In your video, when you try to update, get the error modal, click Back, make the changes (when you changed width/height values to 700), do the the changes save after you hit INSERT and publish the page?

FYI, a bug has been filed: https://jira.atlassian.com/browse/CONFCLOUD-70580

3 Likes

Yes. When I update all macro parameters and hit publish, all are updated. It’s just the macro browser modal that gets confused.