TrackChanges: JS Exception on CTRL+. usage

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • None
    • Affects Version/s: None
    • Component/s: TrackChanges
    • Environment:

      Google Chrome

      problem

      1. Open a segment with content for editing.
      2. double click on the editable text to select the whole segment content
      3. overwrite it with just an x
      4. double click on the text again so that all text (the old one in DEL tags and the new one) is selected.
      5. press CTRL+.
      6. FIRST ERROR: as text is now displayed just an inserted x, nothing is copied from source to target!
      7. double click on the text again so that all text (the new x only) is selected
      8. press CTRL+. again
      9. SECOND ERROR: JS Exception

      Exception

      Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': Only one element on document allowed.
      at constructor.moveNodeOneLevelUp (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilNode.js?_dc=1523458193074:116:25)
      at constructor.addInsForContentByRange (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilInsertion.js?_dc=1523458193074:211:20)
      at constructor.handleAfterInsertMarkup (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/Editor.js?_dc=1523458192491:425:12)
      at constructor.fire (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:20731:42)
      at constructor.dispatch (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:57952:48)
      at constructor.callParent (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:12493:32)
      at constructor.dispatch (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:58196:21)
      at constructor.prototype.doFireEvent (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:58109:30)
      at constructor.fireEventArgs (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:21553:26)
      at constructor.fireEvent (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:21512:25)
       

      solution

      • added: before we insert markup (eg via CTRL+.), we run the TrackChanges on the selected content that will be overwritten
      • fixed: inserting after selecting the complete content works now, also for CTRL+.
      • fixed: when content is inserted after everything has been selected (and "replaced" after the insert), the content will always be inserted at the end

            Assignee:
            Ines-Paul Baumann (Inactive)
            Reporter:
            Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: