Bug 831067 - [Project-wide search and replace] replace count should be the number of strings replaced
[Project-wide search and replace] replace count should be the number of stri...
Product: Zanata
Classification: Community
Component: Component-UI (Show other bugs)
Unspecified Unspecified
high Severity high
: ---
: 1.7
Assigned To: David Mason
Ding-Yi Chen
Depends On:
  Show dependency treegraph
Reported: 2012-06-12 02:42 EDT by Ding-Yi Chen
Modified: 2012-09-12 20:00 EDT (History)
3 users (show)

See Also:
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:
Last Closed: 2012-09-11 01:11:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ding-Yi Chen 2012-06-12 02:42:04 EDT
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:

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 09:47:29 EDT
Request for technical evaluation for 1.7.
Comment 2 David Mason 2012-06-20 21:44:07 EDT
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-18 23:43:41 EDT
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-19 21:32:40 EDT
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.