The action of copy and paste a template variable, while in the editor mode, breaks the variable

XMLWordPrintable

    • 7
    • Severity 3 - Minor
    • 2

      Summary

      In Confluence 6.14.0, we made improvements to Confluence Editor. This change broke the ability of copying a Confluence variable (template) to the same or another template as it consider the variable as an image.

      Steps to Reproduce

      1. Install Confluence 6.14.0 or later
      2. Go to Global Templates and Blueprints page
      3. Click on Add global page template and name it TemplateTest
      4. Create a variable (using the $ shortcut) as $test
      5. Copy and paste the variable on the same page
      6. Save the template
      7. Click on the Create from Template button (. . .)
      8. Choose the TemplateTest and notice that it's broken

      To confirm the problem, install an earlier version of Confluence, for example 6.13.x and follow the same steps, you will notice that the problem is not replicable

      Expected Results

      The variables are working

      Actual Results

      The manually created variable works and the copied variable shows up as an image

      Inspecting the HTML

      If we inspect the HTML via the browser console, we have the following results:

      Variables in 6.14.0 while in editor mode (editing the template)

      • Working variable:
        <img alt="$test" class="template-variable" data-variable-name="test" src="/confluence/plugins/servlet/confluence/placeholder/template-variable?name=test" data-mce-src="http://localhost:8090/confluence/plugins/servlet/confluence/placeholder/template-variable?name=test">
        
      • Copied variable:
        <img class="confluence-embedded-image template-variable confluence-external-resource" src="http://localhost:8090/confluence/plugins/servlet/confluence/placeholder/template-variable?name=test" data-image-src="http://localhost:8090/confluence/plugins/servlet/confluence/placeholder/template-variable?name=test" data-mce-src="http://localhost:8090/confluence/plugins/servlet/confluence/placeholder/template-variable?name=test">
        
        • Notice the new attribute data-image-src and missing attribute: data-variable-name

      Variables in 6.14.0 while in editor mode (using the template to create a page)

      • Working variable:
        <input class="page-template-field" name="variableValues.test" size="12" type="text"> - working
        
      • Copied variable:
        <img class="confluence-embedded-image template-variable confluence-external-resource" src="http://localhost:8090/confluence/plugins/servlet/confluence/placeholder/template-variable?name=test" data-image-src="http://localhost:8090/confluence/plugins/servlet/confluence/placeholder/template-variable?name=test">
        

      Same variables on a Confluence 6.13.0 while in editor mode (editing the template)

      • Working variable:
        <img class="template-variable" alt="$test" data-variable-name="test" src="/c6130/plugins/servlet/confluence/placeholder/template-variable?name=test" data-mce-src="http://localhost:26130/c6130/plugins/servlet/confluence/placeholder/template-variable?name=test">
        
      • Copied variable:
        <img class="template-variable" title="$test" src="http://192.168.10.227:26130/c6130/plugins/servlet/confluence/placeholder/template-variable?name=test" data-variable-name="test" alt="$test" data-attachment-copy="" data-mce-src="http://192.168.10.227:26130/c6130/plugins/servlet/confluence/placeholder/template-variable?name=test">
        
        • Notice that there are no changes that would break it.

      Variables in 6.13.0 while in editor mode (using the template to create a page)

      • Working variable:
        <input class="page-template-field" name="variableValues.test" size="12" type="text">
        
      • Copied variable:
        <input class="page-template-field" name="variableValues.test" size="12" type="text">
        

      Workaround

      Manually add the variable instead of copying it

              Assignee:
              Unassigned
              Reporter:
              Artur J (Inactive)
              Votes:
              13 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated: