Edgewall Software
Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#12585 closed defect (fixed)

Batch-Modify fails on keywords and cc fields

Reported by: helge.wiethoff@… Owned by: Jun Omae
Priority: normal Milestone: 1.0.14
Component: ticket system Version: 1.0.12
Severity: normal Keywords: batch-modify, cc, keywords
Cc:
Release Notes:

Fixed batch-modify not working to list fields and naming conflicts in the form with existing custom fields.

API Changes:

Description

Hi all,

i am not able to use TracBatchModify for keywords or cc fields in Trac 1.0.12. There is no error message. Other fields (no list fields) are handled well.

The Debug Log is not very revealing:

2016-09-13 12:35:02,140 Trac[main] DEBUG: Dispatching <RequestWithSession "POST '/batchmodify'">
2016-09-13 12:35:02,141 Trac[session] DEBUG: Retrieving session for ID u'xxx'
2016-09-13 12:35:02,145 Trac[main] DEBUG: Negotiated locale: None -> de
2016-09-13 12:35:05,046 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/query?status=assigned&status=closed&status=new&status=reopened&col=id&col=summary&col=status&col=type&col=priority&col=milestone&col=component&order=priority'">

Cheers, Helge

Attachments (0)

Change History (14)

comment:1 Changed 2 years ago by Jun Omae

Keywords: batch-modify cc keywords added; BatchModify Keywords removed
Milestone: 1.0.14
Priority: lownormal
Severity: trivialnormal

Good catch. Reproduced on demo-1.0. That's bad.

Adding blah@localhost to cc and #12585 to keywords of #4000,#4002 doesn't work.

Last edited 2 years ago by Ryan J Ollos (previous) (diff)

comment:2 Changed 2 years ago by Jun Omae

Owner: set to Jun Omae
Status: newassigned

Ah, my bad. It seems this issue is introduced in [14724] (#12364).

Could you please try the following patch?

  • trac/ticket/batch.py

    diff --git a/trac/ticket/batch.py b/trac/ticket/batch.py
    index 1b2c6b7c5..98e41762a 100644
    a b class BatchModifyModule(Component):  
    167167                t = Ticket(self.env, int(id))
    168168                _values = new_values.copy()
    169169                for field in list_fields:
    170                     if field in new_values:
     170                    mode = req.args.get('batchmod_value_' + field + '_mode')
     171                    if mode:
    171172                        old = t.values[field] if field in t.values else ''
    172                         new = new_values[field]
    173                         mode = req.args.get('batchmod_value_' + field +
    174                                             '_mode')
     173                        new = req.args.get('batchmod_value_' + field +
     174                                           '_primary')
    175175                        new2 = req.args.get('batchmod_value_' + field +
    176176                                            '_secondary', '')
    177177                        _values[field] = self._change_list(old, new, new2,

comment:3 Changed 2 years ago by Jun Omae

I noticed another issue in batch-modify feature with list format of custom fields.

  1. Custom fields have the following:
    [ticket-custom]
    foo = text
    foo.format = list
    foo_secondary = text
    
  2. Visit query view and select some tickets.
  3. Select foo field in Add Field drop down in batch-modify form.
  4. Select add / remove in drop down and enter blahblah to remove text field.
  5. Submit, foo_secondary field is wrongly updated with blahblah.

Confirmed with Trac 1.0.10 (prior to [14724]) and 1.0.13.

Last edited 2 years ago by Jun Omae (previous) (diff)

comment:4 Changed 2 years ago by anonymous

Hi Jun!

The patch works like a charm :) Thank you very much. But there is a minor problem with the email-notifaction: When email notification is enabled, the batch modification is not recognized:

MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
From: Trac <trac@example.com>
X-Mailer: Trac 1.0.13, by Edgewall Software
X-Trac-Project: Trac
Date: Wed, 14 Sep 2016 08:25:51 +0000
Reply-To: <trac@example.com>
Subject: [Trac] Batch modify: #2471


Batch modification to #2471 by wiethoff:


--
Tickets URL: <https://trac.example.com/it/query?id=2471>
Trac <https://trac.example.com/it>
Trac

Again, thanks for your fast reply.

comment:5 Changed 2 years ago by Jun Omae

Thanks for the testing!

The issue in notification by batch-modify to list fields might be related to #11271 #12174. I try to fix both this issue and #11271.

Last edited 2 years ago by Jun Omae (previous) (diff)

comment:6 Changed 2 years ago by Jun Omae

Proposed changes for this issue and naming conflicts in [374808e87/jomae.git] (jomae.git@t12585).

batchmod_secondary_<name> would be used instead of batchmod_value_<name>_secondary to avoid the naming conflicts.

comment:7 Changed 2 years ago by Ryan J Ollos

The changes work well for me.

comment:8 Changed 2 years ago by Jun Omae

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

Thanks for the reviewing! Committed in [15157] and merged in [15158-15159].

comment:9 Changed 2 years ago by helge.wiethoff@…

in my case the generated mail is still empty :-(

comment:10 in reply to:  9 Changed 2 years ago by Jun Omae

Replying to helge.wiethoff@…:

in my case the generated mail is still empty :-(

That issue has been reported in #11271, not fixed yet.

comment:11 Changed 2 years ago by helge.wiethoff@…

Isnt #11271 about "a better representation"? I see no output at all. Just:

Batch modification to #2541 by wiethoff:

And i thought this was fixed in [15157] but i had no luck with this patch.

comment:12 Changed 2 years ago by Jun Omae

#12174 and #11271 are the same issue.

And i thought this was fixed in [15157] but i had no luck with this patch.

I know.

comment:13 in reply to:  12 Changed 2 years ago by Jun Omae

Replying to Jun Omae:

#12174 and #11271 are the same issue.

And i thought this was fixed in [15157] but i had no luck with this patch.

I know.

The type of #11271 is changed to defect.

comment:14 Changed 2 years ago by helge.wiethoff@…

thanks for the clarification.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted.
to The owner will be changed from Jun Omae 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.