Modify

Opened 4 years ago

Closed 4 years ago

#7490 closed defect (fixed)

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

Reported by: jun66j5 Owned by: 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.

  • batchmod/web_ui.py

     
    146146        if not selectedTickets:
    147147            raise TracError, 'No tickets selected'
    148148
    149         self._save_ticket_changes(req, selectedTickets, tickets,
    150                                   values, comment)
     149        self._save_ticket_changes(req, env, log, selectedTickets, tickets,
     150                                  values, comment, modify_changetime)
    151151
    152152    def _get_new_ticket_values(self, req, env):
    153153        """Pull all of the new values out of the post data."""
     
    172172        if values.has_key('status') and values['status'] is not 'closed':
    173173            values['resolution'] = ''
    174174
    175     def _save_ticket_changes(self, req, selected_tickets, tickets,
    176                              new_values, comment):
     175    def _save_ticket_changes(self, req, env, log, selectedTickets, tickets,
     176                             values, comment, modify_changetime):
    177177        for id in selectedTickets:
    178178            if id in tickets:
    179179                t = Ticket(env, int(id))

Attachments (1)

7490.patch (1.1 KB) - added by nado18@… 4 years ago.
Patch to fix #7490

Download all attachments as: .zip

Change History (8)

comment:1 Changed 4 years ago 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. :(

comment:2 Changed 4 years ago by CuriousCurmudgeon

  • Status changed from new to assigned

comment:3 Changed 4 years ago by CuriousCurmudgeon

  • Resolution set to fixed
  • Status changed from assigned to closed

Thanks for the patch.

comment:4 Changed 4 years ago by nado18@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

Changed 4 years ago by nado18@…

Patch to fix #7490

comment:5 Changed 4 years ago by CuriousCurmudgeon

(In [8370]) refs #7490

  • Applied patch.

comment:6 Changed 4 years ago by CuriousCurmudgeon

(In [8371]) refs #7490

  • Fixed one more parameter naming problem.

comment:7 Changed 4 years ago by CuriousCurmudgeon

  • Resolution set to fixed
  • Status changed from reopened to closed

Add Comment

Modify Ticket

Action
as closed The owner will remain CuriousCurmudgeon.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.