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

Contents with bullets or task list inside templates get erased automatically after saving the template

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Highest Highest
    • 8.8.0, 8.5.7
    • 8.3.0, 8.4.0, 8.3.1, 8.6.0, 8.4.1, 8.5.1, 8.5.2, 8.6.1, 8.3.3, 8.5.3, 8.3.4, 8.4.4, 8.5.4, 8.6.2, 8.7.1, 8.7.2, 8.5.5, 8.5.6

      The fix for this bug has been released to our Long Term Support release.

      The fix for this bug is now available in the latest release of Confluence 8.5

      Issue Summary

      Contents with bullets inside templates get erased automatically after saving the template.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Go to Space Tools > Content tools
      2. Create a new user created template or global template
      3. Add contents with bullets(numbered or unnumbered) and also just texts without any bullets
      4. Save the template and click on edit again
      5. You will notice the contents with bullets are erased along with the text and only the text without any bullets will be present.

      The same happens with the task list as well.

      This issue does not exist for Confluence version < 8.3.0

      Expected Results

      All the contents inside the template must be present.

      Actual Results

      The contents with bullets are erased along with the text and only the text without any bullets will be present.

      Workaround

       

      Workaround 1 (For new template only)

      Add at least one template variable in the template will prevent the bullets / task lists been removed

       

       

      Workaround 2 (For both existing and new template) - Global site administration permission required

      In order to prevent any users mistakenly editing the existing template to cause the list been removed, custom javascript is required to manipulate the source content when template DOM is loaded.

       

      Goto "Confluence administration" > "Custom HTML": add below JavaScript code in "At end of the BODY" and save. Now editing existing template or add new template will not remove the list

       

      <script>
      document.addEventListener('DOMContentLoaded', function() {
        function changeTextareaContent() {
          const editTemplateForm = document.getElementById('editpagetemplate');
          const textarea = document.getElementById('wysiwygTextarea');
          if (editTemplateForm && textarea && textarea.value) {
            textarea.value = textarea.value.replace('<ul data-variable-declarations="true" />', "");
          } 
        }
        changeTextareaContent();
      });
      </script>

       

       

              20f00d30f8b9 Franco Skrzypczak (Inactive)
              b16cacd1db0f Pushpanjali Shivaramu
              Votes:
              39 Vote for this issue
              Watchers:
              53 Start watching this issue

                Created:
                Updated:
                Resolved: