Interference with other Apps

Background

I received a report about an interference with another app in regards to the Button macro. A closer analysis revealed that this other app also installed a page macro with the name “button” just as Bootstrap Visuals does. Confluence gets in trouble if two macros have the same name.

The “name” of a macro is something that the developer of an app picks when a creates a plugin. He should pick a name that is most probably unique in co-existence with other plugins. Shame on me, choosing “button” was obviously not a good choice since I could have expected that someone else would make the same choice not considering a possible interference with other apps..

“Just rename it.” you might say.

True, but then all the existing uses of the Bootstrap Visuals “button” macros would not work anymore. The pages that use the old macro would not find it anymore.

Here is an example. Pages using the button macro would contain something similar to this code:

<ac:structured-macro ac:macro-id="<some-id>" ac:name="button" ac:schema-version="1"/>

When the macro is renamed to something else than “button”, the page would throw an error, something like “Macro not found”.

Workaround

A good solution would be to serve both macro names, the old and the new.

The old one is still good in all instances that do not use any other app using the same macro name. That needs to be considered.

On instances where an interfering app is used, a new unique name would help. That needs to be considered too.

Therefore, since release 2.5.1, two button macros are included in the Bootstrap Visuals app. Both do exactly the same but they have different names. The old one is names “button”, the new one is named “bsvbutton”.

Enabling/disabling the right Button macro

The new button macro named “bsvbutton” is disabled by default when you install/update Bootstrap Visuals to 2.5.1 or higher.

If you don’t experience any interference with any other app you are good. Nothing for you to do.

If you in fact run into an interference. doe the following:

Go to “Manage Apps” of your Confluence instance and click on the Bootstrap Visuals for Confluence app entry. Click on the little + sign next to the text “15 of 16 modules enabled“:

Next is to disable the original “button” macro and enable the new “bsvbutton” macro:

Change existing usages of the original macro

Yes, I know, that’s the bad part. After disabling the old and enabling the new macro, all existing pages using the old one have to be edited to use the new one. If you are using Atlassian’s Source Code App, this is as easy as changing this:

<ac:structured-macro ac:macro-id="<some-id>" ac:name="button" ac:schema-version="1"/>

to this:

<ac:structured-macro ac:macro-id="<some-id>" ac:name="bsvbutton" ac:schema-version="1"/>

Aftermath

It was not a good choice after all to chose such a common name as “button” for such a common feature as a button. Apologies for that.

The provided workaround serves both, users with no interference with aother apps and those that experience them. I hope that you understand that I had to consider both in this case.

Are there more?

If this applies to a common feature like “button”, are there other macros in Bootstrap Visuals that use more or less common names that other apps might use as well?

Yes there are. These are macro names that might be used by other apps as well:

  • alertbox

  • badge

  • buttongroup

  • callout

  • card

  • jumbotron

  • progressbar

  • spinner

I have not received any reports of interference for them yet. But as a preventive measure I have included alternative macros for those as well from version 2.5.1 and up. You can enable them just like the button macro above. Just don’t forget to disable the original ones at the same time.

Last updated