Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10702 closed defect (fixed)

Support for trac 0.11

Reported by: ejucovy Owned by: ejucovy
Priority: normal Component: WorkflowNotificationPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

When active in a Trac 0.11.7 environment, the plugin causes an error in the browser when submitting a new ticket or editing an existing ticket. The error only occurs if one or more notifications would be triggered by the current submission.

The error is:

Python Traceback

Most recent call last:
File "/private/tmp/foos/lib/python2.7/site-packages/trac/web/main.py", line 450, in _dispatch_request
File "/private/tmp/foos/lib/python2.7/site-packages/trac/web/main.py", line 206, in dispatch
File "/private/tmp/foos/lib/python2.7/site-packages/trac/ticket/web_ui.py", line 183, in process_request
File "/private/tmp/foos/lib/python2.7/site-packages/trac/ticket/web_ui.py", line 399, in _process_newticket_request
File "/private/tmp/foos/lib/python2.7/site-packages/trac/ticket/web_ui.py", line 1000, in _do_create
File "/private/tmp/foos/lib/python2.7/site-packages/trac/ticket/model.py", line 214, in insert
File "/private/tmp/trac-WorkflowNotificationPlugin/workflow_notification/__init__.py", line 136, in ticket_created
File "/private/tmp/trac-WorkflowNotificationPlugin/workflow_notification/__init__.py", line 121, in apply_action_side_effects
File "/private/tmp/trac-WorkflowNotificationPlugin/workflow_notification/__init__.py", line 79, in notify

TypeError: notify() takes exactly 3 arguments (4 given)

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by ejucovy

Resolution: fixed
Status: newclosed

Fixed in 46576fe0 and tagged & released as 0.4

Trac's function trac.notification:NotifyEmail.notify changed its signature between 0.12 and 1.0; in 0.12 and earlier versions, it only took two arguments. The plugin now inspects that function's signature to figure out how many arguments to send it.

That's not a public API method in Trac -- the plugin just uses it because it's a reasonably convenient way to send out an email that respects ALWAYS_CC and ALWAYS_BCC and the other general purpose notification settings, but it's a bad hack. At some point it should be replaced with a more stable way to send an email.

comment:2 Changed 12 years ago by Ryan J Ollos

I don't think it's effectively any different than what you did, but Trac actually has a util function even back in 0.11 for checking the number of arguments:.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain ejucovy.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.