Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-19443

Cannot use both HTML macro and BandanaEditor due to persisted classnames not being found by banadana

      The Bandana Editor hasnt worked for me in 3.x for a while now, Ive just done some debugging and found the culprit - the HTML macro, apparently when it persists its configuration under the key com.atlassian.allowed.domains , there is a class name com.atlassian.confluence.plugins.macros.html.WhitelistManager$WhitelistData which cannot be resolved, and causes the Bandana Editor to fail.

      The fix is to not use class names in bandana configuration storage that are not resolveable through other plugins.

      A workaround is to temporarily remove the Whitelist persisted data that causes the problem, for anyone hitting this, here is a beanshell macro to allow you to remove that key:

      {run:heading=Remove Bandana Key|inputSize=80|replace=searchterm:com.yourkey:Search:10:stuff|autorun=false} 
      {beanshell:output=wiki}
      import com.atlassian.bandana.BandanaManager;
      import com.atlassian.confluence.setup.bandana.ConfluenceBandanaContext;
      import com.atlassian.spring.container.ContainerManager;
      
      BandanaManager mgr= ContainerManager.getInstance().getComponent("bandanaManager");
      ConfluenceBandanaContext cctx=new ConfluenceBandanaContext();
      
      Object value=mgr.getValue(cctx, "$searchterm");
      if (value!=null)
      {
         out.println("$searchterm '"+value.getClass().getName()+"' == \n"+value);
         mgr.setValue(cctx, "$searchterm", "");
      }
      else
      {
         out.println("{note:title=Bandana key '$searchterm' not found}Dumping bandana data for investigation{note}");
         out.println("h3. Bandana Context Dump");
         out.println("\{noformat}"+mgr.exportValues(cctx)+"\{noformat}");
      }
      {beanshell}
      {run}
      

            [CONFSERVER-19443] Cannot use both HTML macro and BandanaEditor due to persisted classnames not being found by banadana

            This is fixed by using Confluence Bandana Editor 0.3, which is compatible with Confluence 3.3.3 and up.

            Richard Atkins added a comment - This is fixed by using Confluence Bandana Editor 0.3, which is compatible with Confluence 3.3.3 and up.

            with hindsight, the fix for this is trivial, its just a matter of setting an XStream alias for the given class type on both persist/restore, basically 2lines of code...

            Andy Brook (Javahollic Software) added a comment - with hindsight, the fix for this is trivial, its just a matter of setting an XStream alias for the given class type on both persist/restore, basically 2lines of code...

              richatkins Richard Atkins
              4065af06a75f Andy Brook (Javahollic Software)
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: