#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.
- Open file
- Write text
- Send
Text is set correctly
- Write another text
- Send
Old text is set
Attachments (5)
Change History (16)
Changed 8 years ago by lisaj
comment:1 Changed 8 years ago by garry.yao
- Keywords Confirmed added
- Milestone set to CKEditor 3.0
Changed 8 years ago by garry.yao
comment:2 Changed 8 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 8 years ago by garry.yao
- Owner set to garry.yao
- Status changed from new to assigned
comment:4 Changed 8 years ago by fredck
- Description modified (diff)
comment:5 Changed 8 years ago by fredck
- Keywords Review- added; Review? removed
The proposed solution will not work on the following case:
- Create editor1 : the "original" form.submit function is replaced with "internalFunc1" (named just to make it simple to understand), saving "original".
- Create editor2: the "internalFunc1" reference is now replaced with "internalFunc2", saving "internalFunc1".
- Destroy editor1: the "original" function is set to form.submit, which should be ok.
- 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 8 years ago by garry.yao
comment:6 Changed 8 years ago by garry.yao
- Keywords Review? added; Review- removed
comment:7 Changed 8 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 8 years ago by garry.yao
comment:8 Changed 8 years ago by garry.yao
- Keywords Review? added; Review- removed
Oh, that's my fault.
comment:9 Changed 8 years ago by fredck
- Keywords Review+ added; Review? removed
comment:10 Changed 8 years ago by garry.yao
- Resolution set to fixed
- Status changed from assigned to closed
Fixed with [3949].
comment:11 Changed 8 years ago by lisaj
Its working good.

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