Ticket #934 (closed Bug: fixed)

Opened 7 years ago

Last modified 7 years ago

FCKEditor in modaldialog with plugin

Reported by: paulvrugt Owned by:
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: General Version: FCKeditor 2.4.3
Keywords: Confirmed IE Cc:

Description

Here at Infoland we have a problem using the fckEditor. When using the fckeditor in a modaldialog, we're getting a javascript error when closing the dialog. The error is: "Can't execute code from a freed script".

It seems to be a timing issue since it doesn't occur every time. We've traced the problem to the point where the fckEditor seems to fire an onblur event. The error occurs in FCKFocumManager_FireOnBlur, which calls an anonymous function. Within this anonymous function, the error occurs. But since the code is "compiled", I can't make heads or tails of the code being executed. It's trying to execute a function in an array Called D at position i. So that's not helping. How should I continue to pinpoint the problem and solve it, because we really need this thing to work?

Update:

I've narrowed the problem down quite a bit. I attach an onblur event to the fckeditor in the "FCKeditor_OnComplete" function. This works fine until i load a plugin I created. Once i add the plugin (not even add the toolbarbutton that uses the plugin) the problem occurs. Although the plugin doesn't do anything with onblur events

I've created a testcase to reproduce the problem

Attachments

fckBugTest.zip (8.2 KB) - added by paulvrugt 7 years ago.
I've excluded all fckeditor content from the zip package to reduce size. Just copy the fckeditor into the correct folder and leave the fckconfig.js and the attached plugin

Change History

Changed 7 years ago by paulvrugt

I've excluded all fckeditor content from the zip package to reduce size. Just copy the fckeditor into the correct folder and leave the fckconfig.js and the attached plugin

comment:1 Changed 7 years ago by fredck

You did a great job with the reduced test case. But, I have no problems here. I've tried it with both IE6 and IE7 and no errors have been thrown. Do you have anything online so we can see the problem? Maybe there is something else to be done that we are not aware about.

comment:2 in reply to: ↑ description ; follow-up: ↓ 3 Changed 7 years ago by fredck

  • Keywords Pending added

Replying to paulvrugt:

But since the code is "compiled", I can't make heads or tails of the code being executed.

You should run the editor in _source mode. Check this link for more info on this.

comment:3 in reply to: ↑ 2 Changed 7 years ago by paulvrugt

Maybe I didn't explain myself clear enough. The problem only occurs when pressing the close button in the modaldialog, which calls window.close() . When just closing the modaldialog when pressing the X in the top right corner, no problems occur.

I retried my testcase:

  • Download the zip from this page, and extracted it to a webfolder
  • Download the latest version of the FCKEditor
  • Copy all files of the fckeditor to the fckeditor folder in the testcase
  • Make sure the fckconfig.js and the plugin was not overwritten.
  • Open the dialog.html page, which opens a modaldialog.
  • Type some text in the editor
  • Press the close button

The problem doesnt occur every time, but it happens most of the time

comment:4 Changed 7 years ago by paulvrugt

Great.... The editor removed my linebreaks...In the editor the "step-by-step guide" was a great dashed-list. So just imagine a line-break at every dash :)

comment:5 Changed 7 years ago by fredck

  • Keywords Confirmed IE added; Pending removed

Ok... I was able to reproduce it now. The page must be scrolled down to show the close button, so I was just using the X.

The JS error is thrown always when first placing the cursor in the editor and then clicking on the close button. At that moment the editor looses the focus (onblur) but the dialog closes so quickly that the function is not anymore available. I'll try to find the buggy point in the code.

comment:6 Changed 7 years ago by paulvrugt

That's good news.

Remember: somehow, the error doesnt occur when disabling to customdialog plugin in the fckconfig.js

comment:7 Changed 7 years ago by fredck

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to FCKeditor 2.5

Fixed with [409].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy