Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-84987

Predefined values will not populate in CK Editor

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Duplicate
    • Affects Version/s: 7.0.X
    • Fix Version/s: None
    • Component/s: Dynamic Data Mapping
    • Labels:
    • Fix Priority:
      3

      Description

      Reproduction Steps:

      1. Set up a vanilla DXP with de-44 and hotfix-2146-7010 then and add the following properties to portal-ext.properties file then start it:

      editor.wysiwyg.default=ckeditor
       editor.wysiwyg.portal-impl.portlet.ddm.text_html.ftl=ckeditor
      

      2. Go to Control Panel --> Content --> Web Content and click on the upper right 3 dots and select structure.

      3. Add an HTML field and in the settings as a predefined value add an HTML code then save it.

      I used the HTML:

      <table style="width:100%">
       <tr>
       <th>Firstname</th>
       <th>Lastname</th> 
       <th>Age</th>
       </tr>
       <tr>
       <td>Jill</td>
       <td>Smith</td> 
       <td>50</td>
       </tr>
       <tr>
       <td>Eve</td>
       <td>Jackson</td> 
       <td>94</td>
       </tr>
      </table>

      4. Go to web content and create a web content based on the structure.

      Actual Result: The input of the HTML does not appear in Ckeditor.

      Expected Result: The Ckeditor should display the input of the HTML.

       7.0.x @ d9775f556e16a107e48b5c30f1105e1162751333

       

      note:

      in ddm_form.js

      setValue: function(value) {
       var instance = this;
      
       var editor = instance.getEditor();
      
       var editorComponentName = instance.getInputName() + 'Editor';
      
       var localizationMap = instance.get('localizationMap');
      
       if (isNode(editor)) {
        TextHTMLField.superclass.setValue.apply(instance, arguments);
       }
       else if (editor.instanceReady) {
        editor.setHTML(value);
       }
       else {
        Liferay.after(editorComponentName + ':registered', function() {
         if (value === localizationMap[instance.get('displayLocale')]) {
          editor.setHTML(value);
         }
        });
       }
      },
      

      we check the value against the value in localizationmap, but the predefined value will not be there. That's why we don`t render it. In 7.0.x the issue is reproducible, but only if we the editor.instanceReady is false at the initial render. 

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 44 weeks, 1 day ago

                  Packages

                  Version Package