Ticket #7490 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[Patch] BatchModifyPlugin doesn't work with Trac 0.11.x

Reported by: jun66j5 Assigned to: CuriousCurmudgeon
Priority: normal Component: BatchModifyPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I use batchmodifyplugin/0.11/trunk@8347 and Trac 0.11.7. When I submit "Batch Modify" form, I get the following error.

2010-08-12 16:47:51,177 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11.7.ja1-py2.4.egg/trac/web/main.py", line 450, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.7.ja1-py2.4.egg/trac/web/main.py", line 176, in dispatch
    chosen_handler)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.7.ja1-py2.4.egg/trac/web/main.py", line 296, in _pre_process_request
    chosen_handler = filter_.pre_process_request(req, chosen_handler)
  File "build/bdist.linux-x86_64/egg/batchmod/web_ui.py", line 68, in pre_process_request
  File "build/bdist.linux-x86_64/egg/batchmod/web_ui.py", line 150, in process_request
  File "build/bdist.linux-x86_64/egg/batchmod/web_ui.py", line 177, in _save_ticket_changes
NameError: global name 'selectedTickets' is not defined

The patch fixes the issue.

Index: batchmod/web_ui.py
===================================================================
--- batchmod/web_ui.py  (revision 8354)
+++ batchmod/web_ui.py  (working copy)
@@ -146,8 +146,8 @@
         if not selectedTickets:
             raise TracError, 'No tickets selected'

-        self._save_ticket_changes(req, selectedTickets, tickets,
-                                  values, comment)
+        self._save_ticket_changes(req, env, log, selectedTickets, tickets,
+                                  values, comment, modify_changetime)

     def _get_new_ticket_values(self, req, env):
         """Pull all of the new values out of the post data."""
@@ -172,8 +172,8 @@
         if values.has_key('status') and values['status'] is not 'closed':
             values['resolution'] = ''

-    def _save_ticket_changes(self, req, selected_tickets, tickets,
-                             new_values, comment):
+    def _save_ticket_changes(self, req, env, log, selectedTickets, tickets,
+                             values, comment, modify_changetime):
         for id in selectedTickets:
             if id in tickets:
                 t = Ticket(env, int(id))

Attachments

7490.patch (1.1 kB) - added by nado18@gmail.com on 08/17/10 18:29:08.
Patch to fix #7490

Change History

08/12/10 18:48:47 changed by CuriousCurmudgeon

(In [8358]) refs #7490

  • Applied patch. This is what happens when you are rushing to get things done before leaving and don't test it. :(

08/12/10 18:49:04 changed by CuriousCurmudgeon

  • status changed from new to assigned.

08/12/10 18:49:26 changed by CuriousCurmudgeon

  • status changed from assigned to closed.
  • resolution set to fixed.

Thanks for the patch.

08/17/10 18:28:00 changed by nado18@gmail.com

  • status changed from closed to reopened.
  • resolution deleted.

jun66j5's patch was not applied correctly in [8358], we're still getting the same error. I'm attaching a patch against @8367, please apply it as follows:

cd batchmodifyplugin
patch -p0 < 7490.patch

08/17/10 18:29:08 changed by nado18@gmail.com

  • attachment 7490.patch added.

Patch to fix #7490

08/18/10 17:34:00 changed by CuriousCurmudgeon

(In [8370]) refs #7490

  • Applied patch.

08/18/10 17:35:06 changed by CuriousCurmudgeon

(In [8371]) refs #7490

  • Fixed one more parameter naming problem.

09/13/10 18:10:32 changed by CuriousCurmudgeon

  • status changed from reopened to closed.
  • resolution set to fixed.

Add/Change #7490 ([Patch] BatchModifyPlugin doesn't work with Trac 0.11.x)




Change Properties
Action