Ticket #4073 (closed Bug: fixed)

Opened 8 months ago

Last modified 4 months ago

The Text and Table template will not copy to the editor text area

Reported by: damo Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.1
Component: Core : Styles Version:
Keywords: IBM Confirmed Review+ Cc:

Description (last modified by fredck) (diff)

The Text and Table template will not be copied to the CKEditor text area. This is a problem for IE, only.

Steps to reproduce:

  1. IE6, IE7, or IE8.
  2. Go to CK Editor nightly build => check the demos => Create and destroy editor instances for Ajax applications.
  3. Place the cursor in the CK Editor text area.
  4. Click the Template toolbar icon and select Text and Table.

Expected result:
The Text and Table template is copied to the text area, ready for editing.

Actual result:
The Text and Table template appears to be copied to the text area and is then immediately deleted.

Note 1: This scenario works if the browser is FF3 and Safari.

Note 2: If Replace actual contents option is unchecked, this problem does not occur.

Attachments

4073.patch Download (4.6 KB) - added by garry.yao 7 months ago.
2009-08-31-105015_793x484_scrot.png Download (27.9 KB) - added by tobiasz.cudnik 7 months ago.
4073_2.patch Download (6.5 KB) - added by garry.yao 7 months ago.
4073_3.patch Download (1.9 KB) - added by garry.yao 4 months ago.

Change History

Changed 8 months ago by fredck

  • keywords Confirmed added
  • description modified (diff)
  • milestone changed from CKEditor 3.x to CKEditor 3.1

Confirmed. It happens with that template only, but with the "Strange Template" the caret is positioned in the wrong place (inside a paragraph added before it automagically).

Changed 7 months ago by tobiasz.cudnik

  • owner set to tobiasz.cudnik
  • status changed from new to assigned

Changed 7 months ago by tobiasz.cudnik

  • keywords Pending added

Seem to be fixed with [4030]. I would like to ask for one more confirmation.

Changed 7 months ago by garry.yao

  • keywords Pending removed
  • owner changed from tobiasz.cudnik to garry.yao
  • status changed from assigned to new
  • component changed from General to Core : Styles

It still happened on IE6 for me, I'm taking over this ticket.

Changed 7 months ago by garry.yao

  • status changed from new to assigned

E.g. After insert 'Strange Template', document result in:

^<table>....</table> //For IE
<table><tr><td><h3>^....</table> //For Non-IE

After auto fixing for body logics, it becomes the following, which is wicked:

<p><table>....</table>^</p>

The bug is caused by a bug of range::enlarge which was called inside 'onSelectionChangeFixBody' function.

Changed 7 months ago by garry.yao

Changed 7 months ago by garry.yao

  • keywords Review? added

Changed 7 months ago by tobiasz.cudnik

Changed 7 months ago by tobiasz.cudnik

  • keywords Review- added; Review? removed

I'm still getting this error in IE6 strict after applying the patch.

After first template insertion, it's just truncated. On second try - there is a JS error, which screenshot i'm attaching.

Changed 7 months ago by garry.yao

Changed 7 months ago by garry.yao

  • keywords Review? added; Review- removed

The second patch is trying to avoid the problem at the first place by manually placing the cursor after each template is applied with insert mode, so the 'onSelectionChangeFixBody' would never bother it.
While the changes from the first patch is still a problem, even a serious one, so it could be also reviewed with this ticket.

Changed 4 months ago by fredck

  • keywords Review- added; Review? removed

There are some conflicts with this patch now. It should be reviewed.

Changed 4 months ago by garry.yao

Changed 4 months ago by garry.yao

  • keywords Review? added; Review- removed

Update the patch to trunk.
Note that the range issue would better to be handled by another ticket.

Changed 4 months ago by fredck

  • keywords Review+ added; Review? removed

Changed 4 months ago by garry.yao

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with #4539.

Note: See TracTickets for help on using tickets.