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

Source Editor does not work when Confluence version information is hidden

XMLWordPrintable

      Issue Summary

      Clicking on the Source Editor button does not work and throws an error:

      The source editor requires Confluence 4.1.5 or greater.
      

      The error pops up regardless of running a recent Confluence version.

      Steps to Reproduce

      1. Install a recent Confluence version (such as 7.13.4 LTS or latest)
      2. Install the Confluence Source Editor App version 2.0.0 (or latest)
      3. Hide the version information by executing the steps in How to Hide Version Information on Confluence
      4. Restart Confluence
      5. Create a new Page (or Edit an existing Page)
      6. Click on the Source Editor button (with a "<>" symbol)

      Expected Results

      Users are able to edit Pages via the Source Editor successfully.

      Actual Results

      The Source Editor will not work and a pop-up error will be displayed.

      Cause

      The Source Editor checks compatibility via the "version-number" value:

      function isMinimumVersion() {
          var version = Meta.get('version-number');
          var versionParts = version.split('.');
          if (version.indexOf('SNAPSHOT') >= 0) return true; // always allow snapshot at own peril
      
          var major = parseInt(versionParts.length > 0 && versionParts[0] || 0);
          var minor = parseInt(versionParts.length > 1 && versionParts[1] || 0);
          var patch = parseInt(versionParts.length > 2 && versionParts[2] || 0);
          // Min version = 4.1.5
          if (major > 4) return true;
          if (major === 4 && minor >= 2) return true;
          if (major === 4 && minor === 1 && patch >= 5) return true;
      
          return false;
      }
      

      As it was obfuscated and hard-coded to "1" it will fail the condition every time and return a False regardless of the Confluence version being compatible.

      Workaround

      Use a value of "99.99" that will both satisfy the condition and also obfuscate the Confluence version - or revert the steps covered under How to Hide Version Information on Confluence.

        1. Screen Shot 2022-03-01 at 14.49.49.png
          693 kB
          Thiago Pallaro [Atlassian Support]
        2. Screen Shot 2022-03-01 at 18.47.01.png
          966 kB
          Thiago Pallaro [Atlassian Support]

              zxu2@atlassian.com Zac Xu
              tpallaro@atlassian.com Thiago Pallaro [Atlassian Support]
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: