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:

  1. Open Ajax sample.
  1. Type the word test 2 times and then insert a Table with 3 rows and 2 columns.
  1. Type the word test in all Tables Table cells
  1. Open find and replace dialog, go to replace tab Enter the word(tt) in Find what field and word(xx) in Replace with field
  1. 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.

  1. Click on Replace button again.

It will create a new word xx in the new paragraph above the Table

  1. 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.

  1. Click on Replace button again.

It is adding a new cell in between the first two cells with a new word xx

  1. 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)

6094.patch (410 bytes) - added by Sa'ar Zac Elias 14 years ago.
6094_2.patch (1.3 KB) - added by Garry Yao 14 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 14 years ago by Frederico Caldeira Knabben

Cc: Damian joek added
Keywords: IBM added; damo joek removed
Milestone: CKEditor 3.5

comment:2 Changed 14 years ago by Satya Minnekanti

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.

comment:3 Changed 14 years ago by Sa'ar Zac Elias

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 Sa'ar Zac Elias

Attachment: 6094.patch added

comment:4 Changed 14 years ago by Damian

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 Garry Yao

Attachment: 6094_2.patch added

comment:5 Changed 14 years ago by Garry Yao

Keywords: Discussion HasPatch removed
Owner: set to Garry Yao
Status: newassigned

It's definitely a bug as stated by damo and it's a regression of [5329].

comment:6 Changed 14 years ago by Garry Yao

Status: assignedreview

@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 Sa'ar Zac Elias

Status: reviewreview_passed

comment:8 Changed 14 years ago by Garry Yao

Resolution: fixed
Status: review_passedclosed

Fixed with [5955].

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