Bug #4306

paste in empty editor throws error in opera

Submitted:
2011-04-14 14:17:02 By: wicked
Browsers:
opera opera
Closed Priority: 3 Resolution: Works For Me Assigned to: None
Description of problem:

Steps to reproduce:
1. open demo with opera (11.xx is mine)
2. clear the content
3. paste text with ctrl+v

Expected result:
to paste it correctly and see it

Actual result:
throws error and doesn't display it. also you can't type anymore. if you type first and the paste - works.

 

If you wish to follow or post a comment, you need to be registered and logged in.

Comments

User Image
  • 2011-04-16 19:47:07

alec

I can confirm this. There's no error when paste plugin is disabled.

User Image
  • 2011-04-27 08:17:00

AndyIdol

Yes, i have the same issue with Opera:

Version: 11.10
Build: 2092
Platform: Win32
System: Windows 7
Browser identification: Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.10

...and TinyMCE: tinymce_3.4.2 with jQuery support.

I use minified jQuery 1.4.2.

Thank you.

User Image
  • 2011-05-02 18:38:16

Answerser

+1 Andyldol
It's a serious problem of the opera, the portal is not functioning

User Image
  • 2011-05-04 12:35:45

jerry2

I have the same problem yes. Please fix it, this happened in the latest 3.4 release...

And from imagemanager insert image I have to select image twice (click twice) if I want to be entered into Opera. Paste makes great problems I guess...

User Image
  • 2011-05-04 12:46:28

jerry2

I have the same problem yes. Please fix it, this happened in the latest 3.4 release...

And from imagemanager insert image I have to select image twice (click twice) if I want to be entered into Opera. Paste makes great problems I guess...

User Image
  • 2011-05-04 13:03:06

Kolos

Same Error.

Opera: 11.10
Build: 2092
Platform: Win32

TinyMCE: 3.4.1

User Image
  • 2011-05-06 02:17:37

wwalser

I can't reproduce this with Opera 11 on the demo or locally. Any other reproduction steps?

User Image
  • 2011-05-06 02:56:11

ixy

I might have some more info. I'm not 100% certain it's the same bug but I caught the following when I attempted to insert content into a tinymce textarea using javascript. I don't know if it can shed some light on the situation for anyone.

Uncaught exception: [object DOMException]

Error thrown at line 1, column 172082 in <anonymous function: setRng>(i) in [removed]/tinymce/jscripts/tiny_mce/tiny_mce.js:
g.selectedRange=h.getRangeAt(0)
called from line 1, column 160431 in <anonymous function: setContent>(k, j) in [removed]/tinymce/jscripts/tiny_mce/tiny_mce.js:
h.setRng(f)
called from line 1, column 319317 in <anonymous function: mceInsertContent>(z, D, E) in [removed]/tinymce/jscripts/tiny_mce/tiny_mce.js:
p.setContent('<span id="__mce">\uFEFF</span>',{no_events:false});
called from line 1, column 314074 in q(y, x, v) in [removed]/tinymce/jscripts/tiny_mce/tiny_mce.js:
u(y,x,v);
called from line 1, column 291207 in <anonymous function: execCommand>(x, v, z, p) in [removed]/tinymce/jscripts/tiny_mce/tiny_mce.js:
if(r.editorCommands.execCommand(x,v,z))
called from line 1, column 323698 in <anonymous function: mceReplaceContent>(x, v, u) in [removed]/tinymce/jscripts/tiny_mce/tiny_mce.js:
n.execCommand("mceInsertContent",false,u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))
called from line 1, column 314074 in q(y, x, v) in [removed]/tinymce/jscripts/tiny_mce/tiny_mce.js:
u(y,x,v);
called from line 1, column 291207 in <anonymous function: execCommand>(x, v, z, p) in [removed]/tinymce/jscripts/tiny_mce/tiny_mce.js:
if(r.editorCommands.execCommand(x,v,z))
called from line 1, column 253146 in <anonymous function: execCommand>(r, p, o) in [removed]/tinymce/jscripts/tiny_mce/tiny_mce.js:
return q.activeEditor.execCommand(r,p,o)
called from line 1, column 0 in <anonymous function>(event):
tinyMCE.execCommand('mceReplaceContent',false,'<p>[removed]</p><blockquote><p><span style="text-decoration: line-through;">strike</span>&nbsp;<span style="text-decoration: underline;"><a href="[removed]">underline</a></span></p></blockquote>');

User Image
  • 2011-05-06 08:19:39

jerry2

You have to turn on the paste plugin, without it works ok.

User Image
  • 2011-05-06 09:28:34

wwalser

Ah, I was working under the assumption that the paste plugin was enabled on the "Try it" page.

User Image
  • 2011-05-20 09:19:09

hoanggia87

I can't paste in Opera ver 11.10, 11.11, but with ver 11.01, 11.0 I can do that.
Step by step: bug in Opera (ver 11.10, 11.11)
1. I paste data into editor
2. Next, i can't do anything with editor :(
(If I type something in the Editor, I can paste and edit data in it then)
I hope there would be a new version as soon as possible.
Thank you

User Image
  • 2011-05-20 09:21:51

jerry2

Yes, in older versions it work, in newer it doesn't. SOmebody should post about this in Opera forum also I think. It seems a little like Opera problem.

User Image
  • 2011-07-22 06:03:37

XP1

@ixy, yes. That was the JavaScript error that I got.

@jerry2, I don't think so. It is clearly a JavaScript error. Look at your error console.

Have a look at my blog post.

TinyMCE JavaScript error in Opera (getRangeAt, INDEX_SIZE_ERR):
http://my.opera.com/XP1/blog/2011/07/21/tinymce-javascript-error-in-opera-getrangeat-index-size-err

See my pull request here:
https://github.com/tinymce/tinymce/pull/77

Let me know if testing reveals that it works or doesn't work.

User Image
  • 2011-09-06 13:11:29

spocke

Can't reproduce this error so I won't pull this in since it could break other browsers. Tested on Opera 11.51.

User Image
  • 2011-09-06 13:28:05

alec

I can confirm no issue in Opera 11.51 (Linux).

User Image
  • 2011-09-06 14:03:06

Afraithe

Can not reproduce this in 11.10 on Windows 64. Pasting different content, clearing the area differently etc.

User Image
  • 2011-12-17 06:44:01

XP1

TL;DR: Bug is fixed.

Although some of you cannot reproduce this bug, maybe you could try copying and pasting from a plain textbox to the TinyMCE rich textbox.

Anyway, Jason Frame's bug fix, on November 08, 2011, recognized for Webkit browsers, also fixes the bug in Opera.

Fix exception in setRng for webkit browser where adding range isn't successful and causes an exception setting the selected range:
https://github.com/tinymce/tinymce/blob/347623591030c58bd06fd60c597dac93372d1921/jscripts/tiny_mce/classes/dom/Selection.js

Jason Frame's bug fix does what I did, in a similar fashion, by checking rangeCount to avoid an exception.
"t.selectedRange = s.rangeCount > 0 ? s.getRangeAt(0) : null;"