[BUGFIX] RTE: Uncaught error in Firefox in TYPO3 6.0
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 9 Oct 2012 14:54:01 +0000 (10:54 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 9 Oct 2012 14:56:00 +0000 (16:56 +0200)
This is a regression introduced by fix to issue #41411. In Firefox,
the selection object may not provide any usable range.

Change-Id: I8f6e83ca249fb30299fa5b41755596ed54368343
Resolves: #41796
Releases: 6.0
Reviewed-on: http://review.typo3.org/15450
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/htmlarea/plugins/UndoRedo/undo-redo.js

index 08593a6..9d731e8 100644 (file)
@@ -164,12 +164,12 @@ HTMLArea.UndoRedo = Ext.extend(HTMLArea.Plugin, {
                if (this.getEditorMode() === 'wysiwyg' && this.editor.isEditable()) {
                        if ((!HTMLArea.isIEBeforeIE9 && !(Ext.isOpera && navigator.userAgent.toLowerCase().indexOf('presto/2.1') != -1)) || (HTMLArea.isIEBeforeIE9 && this.editor.getSelection().getType() !== 'Control')) {
                                        // Catch error in FF when the selection contains no usable range
-                               //try {
+                               try {
                                        var range = this.editor.getSelection().createRange();
                                        bookmark = this.editor.getBookMark().get(range, true);
-                               /*} catch (e) {
+                               } catch (e) {
                                        bookmark = null;
-                               }*/
+                               }
                        }
                                // Get the bookmarked html text and remove the bookmark
                        if (HTMLArea.isIEBeforeIE9 && bookmark) {