Opened 7 years ago

Closed 7 years ago

Last modified 7 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 fredck)

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 7 years ago.
3988_TC.html (2.0 KB) - added by garry.yao 7 years ago.
Sample page for reproducing
3988.patch (2.9 KB) - added by garry.yao 7 years ago.
3988_2.patch (1.8 KB) - added by garry.yao 7 years ago.
3988_3.patch (2.1 KB) - added by garry.yao 7 years ago.

Download all attachments as: .zip

Change History (16)

Changed 7 years ago by lisaj

comment:1 Changed 7 years ago by garry.yao

  • Keywords Confirmed added
  • Milestone set to CKEditor 3.0

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

Changed 7 years ago by garry.yao

Sample page for reproducing

Changed 7 years ago by garry.yao

comment:2 Changed 7 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 7 years ago by garry.yao

  • Owner set to garry.yao
  • Status changed from new to assigned

comment:4 Changed 7 years ago by fredck

  • Description modified (diff)

comment:5 Changed 7 years ago by fredck

  • 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 7 years ago by garry.yao

comment:6 Changed 7 years ago by garry.yao

  • Keywords Review? added; Review- removed

comment:7 Changed 7 years ago by fredck

  • 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 7 years ago by garry.yao

comment:8 Changed 7 years ago by garry.yao

  • Keywords Review? added; Review- removed

Oh, that's my fault.

comment:9 Changed 7 years ago by fredck

  • Keywords Review+ added; Review? removed

comment:10 Changed 7 years ago by garry.yao

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [3949].

comment:11 Changed 7 years ago by lisaj

Its working good.

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