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

          Roberto Dominguez created issue -
          Roberto Dominguez made changes -
          Field Original Value New Value
          Attachment brokenpanels-1.0.jar [ 53893 ]
          Roberto Dominguez made changes -
          Attachment brokenpanels-2.0.jar [ 53894 ]
          Roberto Dominguez made changes -
          Attachment brokenpanels-src.zip [ 53895 ]
          Roberto Dominguez made changes -
          Attachment screenshot-1.jpg [ 53896 ]
          Roberto Dominguez made changes -
          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 :(

          The only way I have managed to get the new version if 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:
          {noformat}
          <web-panel key="brokenPanel" location="atl.editor" name="Broken panel in edit window">
              <resource name="view" type="velocity" location="templates/panel.vm"/>
          </web-panel>
          {noformat}

          *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 still show _"Version 2.0"_.
          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 :(

          The only way I have managed to get the new version if 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:
          {noformat}
          <web-panel key="brokenPanel" location="atl.editor" name="Broken panel in edit window">
              <resource name="view" type="velocity" location="templates/panel.vm"/>
          </web-panel>
          {noformat}

          *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"_.
          Roberto Dominguez made changes -
          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 :(

          The only way I have managed to get the new version if 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:
          {noformat}
          <web-panel key="brokenPanel" location="atl.editor" name="Broken panel in edit window">
              <resource name="view" type="velocity" location="templates/panel.vm"/>
          </web-panel>
          {noformat}

          *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"_.
          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 if 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:
          {noformat}
          <web-panel key="brokenPanel" location="atl.editor" name="Broken panel in edit window">
              <resource name="view" type="velocity" location="templates/panel.vm"/>
          </web-panel>
          {noformat}

          *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"_.
          Roberto Dominguez made changes -
          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 if 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:
          {noformat}
          <web-panel key="brokenPanel" location="atl.editor" name="Broken panel in edit window">
              <resource name="view" type="velocity" location="templates/panel.vm"/>
          </web-panel>
          {noformat}

          *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"_.
          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:
          {noformat}
          <web-panel key="brokenPanel" location="atl.editor" name="Broken panel in edit window">
              <resource name="view" type="velocity" location="templates/panel.vm"/>
          </web-panel>
          {noformat}

          *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"_.
          Roberto Dominguez made changes -
          Link This issue is related to BAM-9660 [ BAM-9660 ]
          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
          Roberto Dominguez made changes -
          Link This issue is related to FE-2672 [ FE-2672 ]
          Roberto Dominguez made changes -
          Link This issue is related to JRA-25694 [ JRA-25694 ]
          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.
          Vincent Choy [Atlassian] made changes -
          Status New [ 10034 ] Open [ 1 ]
          Seb Ruiz [Atlassian] made changes -
          Link This issue is related to STASH-2324 [ STASH-2324 ]
          Anton Mazkovoi [Atlassian] made changes -
          Link This issue is related to JRA-25450 [ JRA-25450 ]
          Anton Mazkovoi [Atlassian] made changes -
          Link This issue is related to BAM-9630 [ BAM-9630 ]
          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
          Matthew Erickson [Atlassian] made changes -
          Remote Link This issue links to "Wiki Page (Extranet)" [ 22203 ]
          Joseph Clark [Atlassian] made changes -
          Assignee Joseph Clark [Atlassian] [ jclark@atlassian.com ]
          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
          Joseph Clark [Atlassian] made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 4.3 [ 26037 ]
          Resolution Fixed [ 1 ]
          Joseph Clark [Atlassian] made changes -
          Remote Link This issue links to "ATR-35 (Ecosystem)" [ 25591 ]
          Joseph Clark [Atlassian] made changes -
          Link This issue is related to CONFDEV-9703 [ CONFDEV-9703 ]
          Anatoli Kazatchkov [Administrative Account] made changes -
          Workflow Confluence Bug Workflow [ 351353 ] New Confluence Default Workflow [ 473368 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Last commented:
                1 year, 26 weeks ago