Confluence
  1. Confluence
  2. CONF-23672

web-panels do not get upgraded after plugin upgrade

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0, 4.0.3
    • Fix Version/s: 4.3
    • Component/s: Plugin Framework, Plugins
    • Labels:
      None
    • Last commented by user?:
      true

      Description

      I have a plugin that uses web panels (a vm file) in the Edit Dialog. When I upgrade the plugin, the old version of the template include in the panel is included/rendered

      The only way I have managed to get the new version of the template to get included/rendered is restarting the server. I've attached a couple of plugins to reproduce.

      This is how the panel is defined:

      <web-panel key="brokenPanel" location="atl.editor" name="Broken panel in edit window">
          <resource name="view" type="velocity" location="templates/panel.vm"/>
      </web-panel>
      

      Steps to Reproduce

      • Install Plugin version 1.0
      • Go to any page, and edit it, you'll get an alert message, showing "Version 1.0", which is defined in the panel.vm file.
      • Install Plugin version 2.0 (the panel.vm file has been updated to include "Version 2.0")
      • Go to any page, and edit it, the alert message will still show "Version 1.0".
      • Restart server
      • Go to any page, and edit it, the alert message will finally show "Version 2.0".
      1. brokenpanels-1.0.jar
        5 kB
        Roberto Dominguez
      2. brokenpanels-2.0.jar
        5 kB
        Roberto Dominguez
      3. brokenpanels-src.zip
        5 kB
        Roberto Dominguez
      1. screenshot-1.jpg
        9 kB

        Issue Links

          Activity

          Hide
          Roberto Dominguez added a comment - - edited

          Note that similar issues have been submitted against bamboo, fisheye and jura

          Show
          Roberto Dominguez added a comment - - edited Note that similar issues have been submitted against bamboo, fisheye and jura
          Hide
          Tobias Anstett (K15t Software) added a comment -

          We also tried to workaround this issue by referencing different velocity files in different versions of our plugin, but without server restart (sometimes also deletion of transformed plugins) you will get a ResourceNotFoundException.

          Show
          Tobias Anstett (K15t Software) added a comment - We also tried to workaround this issue by referencing different velocity files in different versions of our plugin, but without server restart (sometimes also deletion of transformed plugins) you will get a ResourceNotFoundException.
          Hide
          Roberto Dominguez added a comment -

          Yeah, try that one already...

          So far the only thing I've found to deal with the issue is gracefully handling it, e.g.:

          try {
              $(".stuf").append(AJS.template.load("newtemplateinnewversion").fill());
          } catch (e) {
              alert("Ad hoc Workflows panel out of sync because of CONF-23672. Please restart server")
          }
          

          The issue has been there for a while... not sure when atlassian is going to look into it, so will probably make it more formal (i.e. storing a version number in the template and validating it).

          Show
          Roberto Dominguez added a comment - Yeah, try that one already... So far the only thing I've found to deal with the issue is gracefully handling it, e.g.: try { $(".stuf").append(AJS.template.load("newtemplateinnewversion").fill()); } catch (e) { alert("Ad hoc Workflows panel out of sync because of CONF-23672. Please restart server") } The issue has been there for a while... not sure when atlassian is going to look into it, so will probably make it more formal (i.e. storing a version number in the template and validating it).
          Hide
          Stefan Kleineikenscheidt (K15t Software) added a comment -

          Hey guys, seem I found a workaround. It's not nice, but seems to work http://www.k15t.com/display/~stefan/2011/10/30/Workaround+for+Web+Panels+on+Confluence+4

          Any feedback is highly appreciated.

          Show
          Stefan Kleineikenscheidt (K15t Software) added a comment - Hey guys, seem I found a workaround. It's not nice, but seems to work http://www.k15t.com/display/~stefan/2011/10/30/Workaround+for+Web+Panels+on+Confluence+4 Any feedback is highly appreciated.
          Hide
          Michael Stelzner [Communardo] added a comment -

          Hi Stefan,

          your code works for me (Confluence 4.1.6). But you should add

          Map<String, Object> defaultContext = MacroUtils.defaultVelocityContext();
          context.putAll(defaultContext);

          into getHtml to access i.e. webResourceManager.

          Michael

          Show
          Michael Stelzner [Communardo] added a comment - Hi Stefan, your code works for me (Confluence 4.1.6). But you should add Map<String, Object> defaultContext = MacroUtils.defaultVelocityContext(); context.putAll(defaultContext); into getHtml to access i.e. webResourceManager. Michael
          Hide
          Joseph Clark [Atlassian] added a comment -

          This was fixed in Confluence 4.3 (upgrade to Atlassian Template Renderer 1.4.0 -> 1.4.2).

          Gory details: https://ecosystem.atlassian.net/browse/ATR-35

          Show
          Joseph Clark [Atlassian] added a comment - This was fixed in Confluence 4.3 (upgrade to Atlassian Template Renderer 1.4.0 -> 1.4.2). Gory details: https://ecosystem.atlassian.net/browse/ATR-35

            People

            • Votes:
              9 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Last commented:
                1 year, 25 weeks, 4 days ago