Bug 831067 - [Project-wide search and replace] replace count should be the number of strings replaced
Summary: [Project-wide search and replace] replace count should be the number of stri...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Zanata
Classification: Retired
Component: Component-UI
Version: 1.6-SNAPSHOT
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 1.7
Assignee: David Mason
QA Contact: Ding-Yi Chen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-12 06:42 UTC by Ding-Yi Chen
Modified: 2012-09-13 00:00 UTC (History)
3 users (show)

Fixed In Version: 1.7-SNAPSHOT (20120720-0026)
Doc Type: Bug Fix
Doc Text:
Cause: After a project-wide search-and-replace operation where not all selected text flows were modified, a message incorrectly reported that the number of selected text flows were modified. Consequence: Users were given misleading information about the number of changes made, particularly where "Search source" or "Search both" options were used. Fix: Change so that only text flows that have actually changed contribute to the reported number of modified text flows. Result: Users are now given accurate information about number of replacements made.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-11 05:11:16 UTC
Embargoed:


Attachments (Terms of Use)

Description Ding-Yi Chen 2012-06-12 06:42:04 UTC
Description of problem:
In "project-wide search/replace", the replace count should be the number of strings replaced, not the number of search result.

This bug is easier to spot if search filter is set as either "Search Both" or "Search Source".

Version-Release number of selected component (if applicable):
Zanata version 1.6.1-SNAPSHOT (20120608-0019)

How reproducible:
Always

Steps to Reproduce:
1. Visit a document with few or no translation (such as Fedora Security Guide)
2. Press "copy from source" in row 1, then remove a term from the translation, save as approved. Suppose the term is "Security"
3. Click "Search and replace"
4. Set the search filter to "Search Both", then search "Security". Row 1 should be contained in the search results.
5. Assume it returns 1 results. Select all search results.
6. Use "Safety" as replace string and perform replace.
  
Actual results:
Message appears: Replaced "Security" with "Safety" in 1 text flows

Expected results:
Message appears: None of the targets have "Security".

Comment 1 Runa Bhattacharjee 2012-06-19 13:47:29 UTC
Request for technical evaluation for 1.7.

Comment 2 David Mason 2012-06-21 01:44:07 UTC
Updating the message about replacements to show how many text flows had actual replacements, and how many were not changed by the replace operation, is technically straightforward.

Note about the replace count:
The number used at the moment is the number of text flows that are selected and have not yet had a replacement made since the last search, so is only equal to the number of results if all results are selected and no replacements have yet been made.
This could be improved by adding distinctive (e.g. green) highlighting to replaced parts of target strings, so that the 'already replaced' state is visible to the user, allowing users to see why replacements are not performed on these text flows even if they are selected.

Comment 3 David Mason 2012-07-19 03:43:41 UTC
Updated so that only targets that have actually changed contribute to the reported number of text flows with replacements.

See https://github.com/zanata/zanata/commit/3e1b12ffc4c65ad92b76b759d24d6ae69f74ed05

Comment 4 Ding-Yi Chen 2012-07-20 01:32:40 UTC
VERIFIED with Zanata version 1.7-SNAPSHOT (20120720-0026)


Note You need to log in before you can comment on or make changes to this bug.