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

    XMLWordPrintable

Details

    Description

      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}
      

      Attachments

        Activity

          People

            richatkins Richard Atkins
            4065af06a75f Andy Brook (Javahollic Software)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: