Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When trying to edit a page in IE8 that contains teaser break, I get the following JavaScript error:
Melding: Ugyldig peker. (=Invalid pointer?)
Linje: 51
Tegn: 5
Kode: 0
URI: http://../dp6/sites/all/modules/wysiwyg/plugins/break/break.js?U
The rich text editor loads, with text and images, but does not show the teaser break line. When disabling rich text I see the
tag.
Whatever editing I try to do does not happen, even if Dupal confirmes that text is updated after saving the page.
Tried editing in "compatibility view" in IE8, and it works OK.
Comment | File | Size | Author |
---|---|---|---|
#9 | wysiwyg_474908_ie_teaser_break3.patch | 1.78 KB | TwoD |
#8 | wysiwyg_474908_ie_teaser_break2.patch | 1.7 KB | TwoD |
#7 | wysiwyg_jwysiwyg_drupal_plugins2.patch | 14.27 KB | TwoD |
#6 | wysiwyg_474908_ie_teaser_break.patch | 1.76 KB | TwoD |
Comments
Comment #1
TwoDI'm assigning this to me. Once again, this has something to do with inserting comments. What fixed it for IE6 and IE7 wasn't enough for IE8 I guesś...
See #404532: TinyMCE/FCKeditor: Teaser break vanishes in IE6/7 for reference. I'll not mark this as duplicate since the consequences are much more severe here because an exception is actually triggered.
And there's a slight chance that it's not exactly the same bug, but still related.
Comment #2
TwoDOf course I forgot to actually do it...
Comment #3
sunI wonder whether jQuery might handle this correctly already? I.e.
At least, it feels a bit strange that we need to "invent" all of this...
Hm... Additionally, there is a conflict in this bug report with the actual error message. That code (line 51) belongs to
but the original post states that the detaching works, but not the attaching...?
Comment #4
TwoDLine 46 in break.js is
* Replace images with <!--break--> tags in content upon detaching editor.
Line 51 in break.js is
$('img.wysiwyg-break', $content).replaceWith(document.createComment('break'));
.I believe that what jofje meant was that the attaching works (as he can edit content, but changes do not stick) but after inserting a Teaser Break, or if one is already present, that error pops up when he disables rich text editing or submits the page, which is when detachment occurs. At least those where the symptoms I saw in IE8 and the debugger.
I've tested
$('img.wysiwyg-break', $content).replaceWith($('<!--break-->'));
in IE6 and it just removes the comment...document.createComment('break')
should be the correct way to do this, but for some reason IE8 doesn't play nice.I've read about some issues where elements created the main
document
in IE8 and then inserted into an iframe will break things because they don't have the same owner document.I'm unsure if this is related to that though.
I'll be able to continue debugging this in about an hour when I get my netbook back.
Comment #5
jofje CreditAttribution: jofje commentedThink TwoD got my message mostly right (English is not my native language, and your disussion about attaching/detaching is a little bit over my technical knowledge).
Anyway to clarify(?) a little:
I use latest dev versions of Image, Image Assist, Wysiwyg and Inline, and with TinyMCE 3.2.4.1.
I have rich text enabled by default.
In IE8 opening and editing of pages without teaser break: All OK
Opening page with previously inserted teaser break (with another browser of course, see below) for editing: No visible teaser break, and a yellow exclamation mark down left (double-clicking that one shows me the before mentioned JS-error; confirmes line 51). Whatever editing I do does not stick.
But, if I disable the rich text editor, I can se the
tag, and editing done while in simple text mode *does* stick, as long as I don't switch back to rich text before saving.
Trying to add new content from scratch using IE8: All OK as long as I don't add teaser break. If I try to add a teaser break to the text, and saves, the result is a new page with zero content - no text, no teaser break, nothing.
Comment #6
TwoDAh, yes. The plugins are detached once upon attaching the editor (triggered internally by FCKeditor), which is why the error appears when jofje opens the page and there's already a teaser break in there.
The changes won't stick because the plugin detach code is called (and fails) during editor detachment which was initiated onSubmit. Because the plugin code fails, FCKeditor doesn't complete its onSubmit routine and the textarea isn't updated with the changed contents.
I have found a solution to the above problem: do not use jQuery to insert the comment, use the appropriate DOM methods instead.
I'm having problems tracing the exact source of the problem within the guts of jQuery. As soon as I try to insert the comment using jQuery it breaks in the
clean
method. When comparing the constructor of the inserted element toNumber
it says that.constructor
is an invalid pointer. Why I don't know, but I can't seem to avoid it by other means than simplifying the operation down to not using jQuery for the actual element insertion. Since the operation is pretty straight forward and not likely to fail, I foresee no problems with this.Tested in IE6/8 and FF3.
Comment #7
TwoDSome cleanups and clarifications, once again thanks to Sun. =)
Comment #8
TwoDOops, wrong file. I'm not having much luck with this upload form, and probably shouldn't write code this late...
Comment #9
TwoDSome more changes, finally done.
Comment #10
TwoDCommitted, with the addition of a few semicolons which kept eluding me. =)
Comment #11
sun@TwoD: For 2.x, you also need a checkout of DRUPAL-5--2 ;)
Also committed to 5.x-2.x.
Comment #12
TwoDOh, right, thanks!
Comment #13
jofje CreditAttribution: jofje commentedLooks promising (even if I don't have a clue about what you are talking about, JQuery and all that). Don't have time to test right now, but will report back tomorrow at the latest.
Guess it doesn't matter that TwoD talkes about FCKeditor in #6 (I have never used it, just TinyMCE)?
Comment #14
TwoDI was using FCKeditor at the time of writing #6, but of course this applies to any editor supporting Drupal plugins like Teaser Break, as they would all run that code.