Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-12423

Fix spurious safe edit saving on tinyMCE editors without changes

    XMLWordPrintable

    Details

      Description

      The note editor (tinyMCE) is triggering a change detection on FF 14.0.1 (and FF 3.6) even if there are no changes.

      This is visible when adding debug logs in safeEdit.js, method saveForm: the last saved json data contains:

      {"document_edit":"document_edit",
      "document_edit:nxl_heading:nxw_title":"testNote1",
      "document_edit:nxl_heading:nxw_description":"desc testNote1",
      "document_edit:nxl_note:j_id420:nxw_note_editor":"",
      "document_edit:nxl_note:j_id420:nxw_note_editor_ifr":"<br>",
      "document_edit:nxl_note:j_id420:nxw_note_disableHtmlInit":"false",
      "document_edit:nxl_note:j_id420:nxw_note_editorselector":"text/html",
      "document_edit:nxl_dublincore:nxw_nature_select2_init":"",
      "s2id_autogen1":"",
      "document_edit:nxl_dublincore:nxw_nature_select2":"",
      "document_edit:nxl_dublincore:nxw_nature_select2_params":"{\"multiple\":\"false\",
      \"translateLabels\":\"true\",
      \"minChars\":\"0\",
      \"directoryName\":\"nature\",
      \"hideInstructionLabel\":\"true\",
      \"width\":\"300\",
      \"placeholder\":\"Select a value\",
      \"suggestionFormatter\":\"dirEntryDefaultFormatter\",
      \"selectionFormatter\":\"dirEntryDefaultFormatter\",
      \"readonly\":\"false\"}",
      "document_edit:nxl_dublincore:nxw_subjects_select2_init":"[]",
      "document_edit:nxl_dublincore:nxw_subjects_select2":"",
      "document_edit:nxl_dublincore:nxw_subjects_select2_params":"{\"multiple\":\"true\",
      \"translateLabels\":\"true\",
      \"minChars\":\"0\",
      \"dbl10n\":\"true\",
      \"directoryName\":\"l10nsubjects\",
      \"hideInstructionLabel\":\"true\",
      \"width\":\"300\",
      \"placeholder\":\"Select a value\",
      \"suggestionFormatter\":\"dirEntryDefaultFormatter\",
      \"selectionFormatter\":\"dirEntryDefaultFormatter\",
      \"readonly\":\"false\"}",
      "document_edit:nxl_dublincore:nxw_rights":"",
      "document_edit:nxl_dublincore:nxw_source":"",
      "document_edit:nxl_dublincore:nxw_coverage_select2_init":"",
      "s2id_autogen3":"",
      "document_edit:nxl_dublincore:nxw_coverage_select2":"",
      "document_edit:nxl_dublincore:nxw_coverage_select2_params":"{\"multiple\":\"false\",
      \"translateLabels\":\"true\",
      \"minChars\":\"0\",
      \"dbl10n\":\"true\",
      \"directoryName\":\"l10ncoverage\",
      \"hideInstructionLabel\":\"true\",
      \"width\":\"300\",
      \"placeholder\":\"Select a value\",
      \"suggestionFormatter\":\"dirEntryDefaultFormatter\",
      \"selectionFormatter\":\"dirEntryDefaultFormatter\",
      \"readonly\":\"false\"}",
      "document_edit:nxl_dublincore:nxw_format":"",
      "document_edit:nxl_dublincore:nxw_language":"",
      "document_edit:nxl_dublincore:nxw_expiredInputDate":"",
      "document_edit:nxl_dublincore:nxw_expiredInputCurrentDate":"09/2013",
      "document_edit:nxl_document_edit_form_options:nxw_document_edit_comment":"",
      "document_edit:nxl_document_edit_form_options:nxw_select:0":true,
      "document_edit:nxl_document_edit_form_options:nxw_select:1":false,
      "document_edit:nxl_document_edit_form_options:nxw_select:2":false}
      @ http://localhost:8080/nuxeo/scripts/safeEdit.js:93
      

      The new json data contains:

      "document_edit":"document_edit",
      "document_edit:nxl_heading:nxw_title":"testNote1",
      "document_edit:nxl_heading:nxw_description":"desc testNote1",
      "document_edit:nxl_note:j_id420:nxw_note_editor":"<p><br data-mce-bogus=\"1\"></p>",
      "document_edit:nxl_note:j_id420:nxw_note_editor_ifr":"<p><br data-mce-bogus=\"1\"></p>",
      "document_edit:nxl_note:j_id420:nxw_note_disableHtmlInit":"false",
      "document_edit:nxl_note:j_id420:nxw_note_editorselector":"text/html",
      "document_edit:nxl_dublincore:nxw_nature_select2_init":"",
      "s2id_autogen1":"",
      "document_edit:nxl_dublincore:nxw_nature_select2":"",
      "document_edit:nxl_dublincore:nxw_nature_select2_params":"{\"multiple\":\"false\",
      \"translateLabels\":\"true\",
      \"minChars\":\"0\",
      \"directoryName\":\"nature\",
      \"hideInstructionLabel\":\"true\",
      \"width\":\"300\",
      \"placeholder\":\"Select a value\",
      \"suggestionFormatter\":\"dirEntryDefaultFormatter\",
      \"selectionFormatter\":\"dirEntryDefaultFormatter\",
      \"readonly\":\"false\"}",
      "document_edit:nxl_dublincore:nxw_subjects_select2_init":"[]",
      "document_edit:nxl_dublincore:nxw_subjects_select2":"",
      "document_edit:nxl_dublincore:nxw_subjects_select2_params":"{\"multiple\":\"true\",
      \"translateLabels\":\"true\",
      \"minChars\":\"0\",
      \"dbl10n\":\"true\",
      \"directoryName\":\"l10nsubjects\",
      \"hideInstructionLabel\":\"true\",
      \"width\":\"300\",
      \"placeholder\":\"Select a value\",
      \"suggestionFormatter\":\"dirEntryDefaultFormatter\",
      \"selectionFormatter\":\"dirEntryDefaultFormatter\",
      \"readonly\":\"false\"}",
      "document_edit:nxl_dublincore:nxw_rights":"",
      "document_edit:nxl_dublincore:nxw_source":"",
      "document_edit:nxl_dublincore:nxw_coverage_select2_init":"",
      "s2id_autogen3":"",
      "document_edit:nxl_dublincore:nxw_coverage_select2":"",
      "document_edit:nxl_dublincore:nxw_coverage_select2_params":"{\"multiple\":\"false\",
      \"translateLabels\":\"true\",
      \"minChars\":\"0\",
      \"dbl10n\":\"true\",
      \"directoryName\":\"l10ncoverage\",
      \"hideInstructionLabel\":\"true\",
      \"width\":\"300\",
      \"placeholder\":\"Select a value\",
      \"suggestionFormatter\":\"dirEntryDefaultFormatter\",
      \"selectionFormatter\":\"dirEntryDefaultFormatter\",
      \"readonly\":\"false\"}",
      "document_edit:nxl_dublincore:nxw_format":"",
      "document_edit:nxl_dublincore:nxw_language":"",
      "document_edit:nxl_dublincore:nxw_expiredInputDate":"",
      "document_edit:nxl_dublincore:nxw_expiredInputCurrentDate":"09/2013",
      "document_edit:nxl_document_edit_form_options:nxw_document_edit_comment":"",
      "document_edit:nxl_document_edit_form_options:nxw_select:0":true,
      "document_edit:nxl_document_edit_form_options:nxw_select:1":false,
      "document_edit:nxl_document_edit_form_options:nxw_select:2":false}
      @ http://localhost:8080/nuxeo/scripts/safeEdit.js:92
      

      Here is the diff:

      -"document_edit:nxl_note:j_id420:nxw_note_editor":"",
      -"document_edit:nxl_note:j_id420:nxw_note_editor_ifr":"<br>",
      +"document_edit:nxl_note:j_id420:nxw_note_editor":"<p><br data-mce-bogus=\"1\"></p>",
      +"document_edit:nxl_note:j_id420:nxw_note_editor_ifr":"<p><br data-mce-bogus=\"1\"></p>",
       "document_edit:nxl_note:j_id420:nxw_note_disableHtmlInit":"false",
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: