Edgewall Software
Modify

Opened 5 months ago

Closed 4 months ago

#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:

Fixed regression in ticket list changes that led to display of empty property change.

API Changes:

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

EmptyChange.png (3.1 KB ) - added by anonymous 5 months ago.
Screen Shot 2019-07-19 at 14.44.11.jpg (6.2 KB ) - added by Ryan J Ollos 5 months ago.
Screen Shot 2019-07-23 at 22.09.18.jpg (30.7 KB ) - added by Ryan J Ollos 5 months ago.
Screen Shot 2019-07-23 at 22.10.45.jpg (38.4 KB ) - added by Ryan J Ollos 5 months ago.
Screen Shot 2019-07-23 at 22.11.36.jpg (9.9 KB ) - added by Ryan J Ollos 5 months ago.

Download all attachments as: .zip

Change History (25)

by anonymous, 5 months ago

Attachment: EmptyChange.png added

comment:1 by anonymous, 5 months ago

It looks like this:

comment:2 by Ryan J Ollos, 5 months ago

I have tested with 1.0-stable, 1.2-stable and trunk, and cannot reproduce. What is your Trac version?

comment:3 by anonymous, 5 months 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:4 by Ryan J Ollos, 5 months ago

Would you mind testing with 1.3.5? It was released a few days ago.

comment:5 by Ryan J Ollos, 5 months ago

Also, please post your list of installed plugins.

comment:6 by anonymous, 5 months ago

I can not reproduce the issue either, even on the same site as it happened once.

by Ryan J Ollos, 5 months ago

comment:7 by Ryan J Ollos, 5 months 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 wikimacroswikimacros (trailing whitespace), and then batch modifying like you did, I get similar, but not exactly the result you showed:

comment:8 by Ryan J Ollos, 5 months 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.

Last edited 5 months ago by Ryan J Ollos (previous) (diff)

comment:9 by Ryan J Ollos, 5 months ago

Proposed refactoring: [a16576607/rjollos.git]. It won't affect the behavior reported in this ticket, just some code I noticed could be improved.

comment:10 by anonymous, 5 months 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?

in reply to:  9 comment:11 by Ryan J Ollos, 5 months 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:12 by Ryan J Ollos, 5 months ago

comment:11 changes committed in r17000.

in reply to:  10 comment:13 by Ryan J Ollos, 5 months 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 anonymous, 5 months 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 Ryan J Ollos, 5 months ago

by Ryan J Ollos, 5 months ago

by Ryan J Ollos, 5 months ago

comment:15 by Ryan J Ollos, 5 months ago

Component: generalticket system
Keywords: batch-modify added
Milestone: 1.3.6
Owner: set to Ryan J Ollos
Status: newassigned

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:

comment:16 by Ryan J Ollos, 4 months 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.

Last edited 4 months ago by Ryan J Ollos (previous) (diff)

comment:17 by Ryan J Ollos, 4 months ago

Does ; need to be localized?: trunk/trac/ticket/web_ui.py@17000:1787#L1775

Last edited 4 months ago by Ryan J Ollos (previous) (diff)

comment:18 by Ryan J Ollos, 4 months ago

Proposed changes in rjollos.git:t13179_list_change. The changes should restore the behavior from 1.2-stable.

in reply to:  16 comment:19 by Ryan J Ollos, 4 months ago

Replying to Ryan J Ollos:

I noticed we allow duplicate keywords (same behavior on 1.0-stable).

#13185.

comment:20 by Ryan J Ollos, 4 months ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

comment:18 changes committed in r17003.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.