#13179 closed defect (fixed)
Batch Modify add/remove keyword: Empty change
Reported by: | anonymous | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | low | Milestone: | 1.3.6 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | batch-modify batch-modify |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Fixed regression in ticket list changes that led to display of empty property change. |
Description
Example scenario: Assume that you want to cleanup the keywords and change wikimacros
to wiki-macros
:
- Go to query:keywords~=wikimacros page.
- Check all tickets.
- Open Batch Modify section.
- In Add Field dropdown select Keywords.
- Select add / remove.
- Enter
add: wikimacros remove: wiki-macros
.- (This is a user error. Intended was the inverse:
add: wiki-macros remove: wikimacros
.)
- (This is a user error. Intended was the inverse:
- Click Change tickets button.
- Now navigate to one of the changed tickets.
- Observed behavior: A change history entry was added to the ticket, with a yellow box indicating the change to the keywords field; but there is no actual change, the keywords have remained as they were.
- Expected behavior: I'm unsure. Maybe this is working as intended? Maybe the ticket should remain unchanged? Maybe there was actually a (subtle) change, but it is not shown clearly? Maybe it should warn that no tickets actually match the removed keyword?
Attachments (5)
Change History (26)
by , 5 years ago
Attachment: | EmptyChange.png added |
---|
comment:1 by , 5 years ago
comment:2 by , 5 years ago
I have tested with 1.0-stable, 1.2-stable and trunk, and cannot reproduce. What is your Trac version?
comment:3 by , 5 years ago
According to Trac "About" page : "Trac 1.3.3dev"
According to svn info
: "URL: https://svn.edgewall.org/repos/trac/trunk" / "Revision: 16660"
Unfortunately the Trac demo sites don't seem to allow testing Batch Modify functionality.
comment:6 by , 5 years ago
I can not reproduce the issue either, even on the same site as it happened once.
by , 5 years ago
Attachment: | Screen Shot 2019-07-19 at 14.44.11.jpg added |
---|
comment:7 by , 5 years ago
Is there anything unique about the history of the Trac site? What version did you start with, and how long has the environment existed? Did you import tickets using a TracImport plugin?
Directly modifying the database with replacement wikimacros
→ wikimacros
(trailing whitespace), and then batch modifying like you did, I get similar, but not exactly the result you showed:
comment:8 by , 5 years ago
Running a query on your database for those tickets would be helpful. Something like:
../tracenvs/proj-1.3/db/trac.db> SELECT * FROM ticket_change WHERE ticket_change.oldvalue LIKE "%wikimacros %" +--------+------------------+--------+----------+-------------+------------+ | ticket | time | author | field | oldvalue | newvalue | +--------+------------------+--------+----------+-------------+------------+ | 12 | 1563572395766077 | user1 | keywords | wikimacros | wikimacros | | 61 | 1563572395766077 | user1 | keywords | wikimacros | wikimacros | | 83 | 1563572395766077 | user1 | keywords | wikimacros | wikimacros | | 94 | 1563572395766077 | user1 | keywords | wikimacros | wikimacros | +--------+------------------+--------+----------+-------------+------------+ 4 rows in set Time: 0.010s
For your database, the following might be more useful: SELECT * FROM ticket_change WHERE field="keywords" AND ticket=<id>
, with <id>
replaced by the ticket from your comment:1 screen capture.
follow-up: 11 comment:9 by , 5 years ago
Proposed refactoring: [a16576607/rjollos.git]. It won't affect the behavior reported in this ticket, just some code I noticed could be improved.
follow-up: 13 comment:10 by , 5 years ago
sqlite> SELECT * FROM ticket_change WHERE field="keywords" AND ticket=3427; 3427|1538576096953185|anonymous|keywords|python OpenSSH tox|python OpenSSH tox wikimacros 3427|1563349480998871|anonymous|keywords|python OpenSSH tox wikimacros|python, OpenSSH, tox, wikimacros 3427|1563349905915175|anonymous|keywords|python, OpenSSH, tox, wikimacros|python, OpenSSH, tox, wiki-macros
The second entry seems to be the case above. (And the third what was intended in the first place, with the keywords switched around correctly.)
Maybe the adding of ,
is what confuses the issue?
comment:11 by , 5 years ago
Replying to Ryan J Ollos:
Proposed refactoring: [a16576607/rjollos.git]. It won't affect the behavior reported in this ticket, just some code I noticed could be improved.
Additional refactoring in log:rjollos.git:t13179_refactoring.
comment:13 by , 5 years ago
Replying to anonymous:
Maybe the adding of
,
is what confuses the issue?
Thanks, will investigate.
What is the history of the site? What version did you start with, and what has been the progression of upgrades, as best you can remember?
comment:14 by , 5 years ago
Best guess it probably started with 0.11.X and was upgraded via 0.12.X, 0.13.X, 1.0.X, 1.1.X, 1.2.X, 1.3.X as needed. I don't know how I could check the exact upgrades / versions.
by , 5 years ago
Attachment: | Screen Shot 2019-07-23 at 22.09.18.jpg added |
---|
by , 5 years ago
Attachment: | Screen Shot 2019-07-23 at 22.10.45.jpg added |
---|
by , 5 years ago
Attachment: | Screen Shot 2019-07-23 at 22.11.36.jpg added |
---|
comment:15 by , 5 years ago
Component: | general → ticket system |
---|---|
Keywords: | batch-modify added |
Milestone: | → 1.3.6 |
Owner: | set to |
Status: | new → assigned |
Reproduced by creating a ticket with keywords python OpenSSH tox wikimacros
. Followed by batch modification:
- Add:
wikimacros,
Remove:wiki-macros
Note the trailing comma for the Add value.
proj-1.3/db/trac.db> SELECT oldvalue,newvalue FROM ticket_change WHERE ticket=101 +-------------------------------+----------------------------------+ | oldvalue | newvalue | +-------------------------------+----------------------------------+ | python OpenSSH tox wikimacros | python, OpenSSH, tox, wikimacros | | 1 | | +-------------------------------+----------------------------------+ 2 rows in set Time: 0.010s
On 1.0-stable, the ticket change is:
On 1.2-stable:
On trunk:
follow-up: 19 comment:16 by , 5 years ago
Keywords: | batch-modify → batch-modify batch-modify |
---|
I noticed we allow duplicate keywords (same behavior on 1.0-stable). To avoid duplicates, I propose that we define a separator (could be configurable using an option [ticket]
list_separator
), parse the list field with separators ;,\s
on ticket save, store the values in the database as a whitespace-seperated string, and join the fields using the defined separator when rendering. I don't plan to propose any of those changes in this ticket.
comment:17 by , 5 years ago
Does ;
need to be localized?: trunk/trac/ticket/web_ui.py@17000:1787#L1775
comment:18 by , 5 years ago
Proposed changes in rjollos.git:t13179_list_change. The changes should restore the behavior from 1.2-stable.
comment:19 by , 5 years ago
Replying to Ryan J Ollos:
I noticed we allow duplicate keywords (same behavior on 1.0-stable).
⇒ #13185.
comment:20 by , 5 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:18 changes committed in r17003.
It looks like this: