#12585 closed defect (fixed)
Batch-Modify fails on keywords and cc fields
| Reported by: | 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: | Branch: | ||
| Release Notes: |
Fixed batch-modify not working to list fields and naming conflicts in the form with existing custom fields. |
||
| API Changes: | |||
| Internal 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 by , 9 years ago
| Keywords: | batch-modify cc keywords added; BatchModify Keywords removed |
|---|---|
| Milestone: | → 1.0.14 |
| Priority: | low → normal |
| Severity: | trivial → normal |
comment:2 by , 9 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
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): 167 167 t = Ticket(self.env, int(id)) 168 168 _values = new_values.copy() 169 169 for field in list_fields: 170 if field in new_values: 170 mode = req.args.get('batchmod_value_' + field + '_mode') 171 if mode: 171 172 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') 175 175 new2 = req.args.get('batchmod_value_' + field + 176 176 '_secondary', '') 177 177 _values[field] = self._change_list(old, new, new2,
comment:3 by , 9 years ago
I noticed another issue in batch-modify feature with list format of custom fields.
- Custom fields have the following:
[ticket-custom] foo = text foo.format = list foo_secondary = text
- Visit query view and select some tickets.
- Select
foofield inAdd Fielddrop down in batch-modify form. - Select
add / removein drop down and enterblahblahtoremovetext field. - Submit,
foo_secondaryfield is wrongly updated withblahblah.
Confirmed with Trac 1.0.10 (prior to [14724]) and 1.0.13.
comment:4 by , 9 years ago
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 by , 9 years ago
comment:6 by , 9 years ago
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:8 by , 9 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Thanks for the reviewing! Committed in [15157] and merged in [15158-15159].
comment:10 by , 9 years ago
Replying to helge.wiethoff@…:
in my case the generated mail is still empty :-(
That issue has been reported in #11271, not fixed yet.



Good catch. Reproduced on demo-1.0. That's bad.
Adding
blah@localhostto cc and#12585to keywords of#4000,#4002doesn't work.