Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#3988 closed Bug (fixed)

[FF] Can not second save

Reported by: lisaj Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.0
Component: General Version:
Keywords: Confirmed Review+ Cc:

Description (last modified by Frederico Caldeira Knabben)

In firefox (tested 3.0, 3.5) if send data via ajax and recreate editor second send no change text area. I create test file with sam error.

  1. Open file
  2. Write text
  3. Send

Text is set correctly

  1. Write another text
  2. Send

Old text is set

Attachments (5)

test.htm (1.6 KB) - added by lisaj 16 years ago.
3988_TC.html (2.0 KB) - added by Garry Yao 16 years ago.
Sample page for reproducing
3988.patch (2.9 KB) - added by Garry Yao 16 years ago.
3988_2.patch (1.8 KB) - added by Garry Yao 16 years ago.
3988_3.patch (2.1 KB) - added by Garry Yao 16 years ago.

Download all attachments as: .zip

Change History (16)

Changed 16 years ago by lisaj

Attachment: test.htm added

comment:1 Changed 16 years ago by Garry Yao

Keywords: Confirmed added
Milestone: CKEditor 3.0

Providing a reduced TC.
The bug is actually due to the call to editor.destroy() on submit event.

Changed 16 years ago by Garry Yao

Attachment: 3988_TC.html added

Sample page for reproducing

Changed 16 years ago by Garry Yao

Attachment: 3988.patch added

comment:2 Changed 16 years ago by Garry Yao

Keywords: Review? added

@lisaj
I didn't test the patch with your original problematic sample page, please help us to verify it with nightly build after this ticket get fixed.

comment:3 Changed 16 years ago by Garry Yao

Owner: set to Garry Yao
Status: newassigned

comment:4 Changed 16 years ago by Frederico Caldeira Knabben

Description: modified (diff)

comment:5 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

The proposed solution will not work on the following case:

  1. Create editor1 : the "original" form.submit function is replaced with "internalFunc1" (named just to make it simple to understand), saving "original".
  1. Create editor2: the "internalFunc1" reference is now replaced with "internalFunc2", saving "internalFunc1".
  1. Destroy editor1: the "original" function is set to form.submit, which should be ok.
  1. Destroy editor2: the "internalFunc1" function is set to form.submit... things are broken again.

So, it should be better to not interfere on the function calling chain, where "internalFunc2" calls "internalFunc1" which calls "original". We could change this model, but then the change would be much more drastic.

To maintain the current code structure, we could simply set editor.dead = true into destroy(), and then make this "dead" check before calling editor.updateElement(), in attachToForm, eventually removing the form.on('submit') handler at that point.

Changed 16 years ago by Garry Yao

Attachment: 3988_2.patch added

comment:6 Changed 16 years ago by Garry Yao

Keywords: Review? added; Review- removed

comment:7 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

The code is ok, but the "afterDestroy" event is not thrown anywhere. Other than that, let's simply call this event "destroy". We could use "before" and "after" for every single event, but we must keep it logical and simple. The "destroy" event should be thrown when the editor is about to be destroyed.

Changed 16 years ago by Garry Yao

Attachment: 3988_3.patch added

comment:8 Changed 16 years ago by Garry Yao

Keywords: Review? added; Review- removed

Oh, that's my fault.

comment:9 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:10 Changed 16 years ago by Garry Yao

Resolution: fixed
Status: assignedclosed

Fixed with [3949].

comment:11 Changed 16 years ago by lisaj

Its working good.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy