Opened 14 years ago
Closed 14 years ago
#6094 closed Bug (fixed)
Find & replace is not working properly with Tables in the content.
Reported by: | Satya Minnekanti | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.4.2 |
Component: | General | Version: | 3.3 |
Keywords: | IBM | Cc: | Damian, joek |
Description
To reproduce the defect:
- Open Ajax sample.
- Type the word test 2 times and then insert a Table with 3 rows and 2 columns.
- Type the word test in all Tables Table cells
- Open find and replace dialog, go to replace tab Enter the word(tt) in Find what field and word(xx) in Replace with field
- click on Replace button.
Expected result:
An error dialog should come up saying "The specified text was not found".
Actual Result:
It is highlighting last Char 't' in the last word before the table and first character 't' in the first word in first Table cell.
- Click on Replace button again.
It will create a new word xx in the new paragraph above the Table
- Click on Replace button again.
It is highlighting last Char 't' in the word in first Table cell and first character 't' in the first word in second Table cell.
- Click on Replace button again.
It is adding a new cell in between the first two cells with a new word xx
- Click on Replace button again
It is removing all Table cells and leaving just one Cell with word es
And when we Replace after that we are not getting any error dialog or any error.
if we repeat the above procedure by clicking on Replace All button we are getting a dialog saying 6 ocurrences replaced and it is adding anew cell between each Table Row and it is adding a new word xx above the table.
Attachments (2)
Change History (10)
comment:1 Changed 14 years ago by
Cc: | Damian joek added |
---|---|
Keywords: | IBM added; damo joek removed |
Milestone: | → CKEditor 3.5 |
comment:2 Changed 14 years ago by
comment:3 Changed 14 years ago by
Keywords: | Discussion HasPatch added |
---|
The problem is that we're not checking the boundary unless we use "match full word". It also happens with images. Fixing it is easy, but it might not be the expected behaviour so I think it'd be better to hear some more opinions. I'm attaching a patch for this approach meanwhile.
Changed 14 years ago by
Attachment: | 6094.patch added |
---|
comment:4 Changed 14 years ago by
As I see it, the walker should not match across line breaks, cell boundaries etc. This seems just wrong. The majority of text editors/word processors that I've seen would not match words like this.
Changed 14 years ago by
Attachment: | 6094_2.patch added |
---|
comment:5 Changed 14 years ago by
Keywords: | Discussion HasPatch removed |
---|---|
Owner: | set to Garry Yao |
Status: | new → assigned |
It's definitely a bug as stated by damo and it's a regression of [5329].
comment:6 Changed 14 years ago by
Status: | assigned → review |
---|
@Sarre, as you caught, the checking the boundary logic should only be performed as guard when checking a full match.
comment:7 Changed 14 years ago by
Status: | review → review_passed |
---|
comment:8 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed with [5955].
This is also happening when we have words in 2 different paragraphs.
Type the same text (test test test ) in 2 different paragraphs click on find and replace and enter 'tt' in the Find what field and enter 'xxx' in th Replace with field.
Try to press Replace button and see that it will highlight the lats 't' in first paragraph and first 't' in second paragraph and when we click replace button for second time it will create a new word 'xxx' in a new paragraph between 2 paragraphs.