Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10506 closed defect (fixed)

Ticket update fails with HTTP 500 if Agilo for Trac installed

Reported by: ps@… Owned by: Björn Harrtell
Priority: normal Component: GridModifyPlugin
Severity: critical Keywords: Agilo
Cc: Trac Release: 0.12

Description

When trying to change a field from the query table, the browser issues an AJAX request like this:

http://trac.domain.ch/trac/Project/gridmod/update?_=1350658481047&ticket=1&component=SomeComp

With Agilo 1.3.8 installed along GridModifyPlugin 0.1.5 this results in the following exception:

  File "build/bdist.linux-i686/egg/gridmod/web_ui.py", line 103, in process_request
    ticket.save_changes(author=req.authname, comment='updated by gridmod plugin')
  File "/opt/bitnami/python/lib/python2.6/site-packages/binary_agilo-1.3.8_PRO-py2.6.egg/agilo/ticket/model.py", line 819, in save_changes
    self._check_business_rules()
  File "/opt/bitnami/python/lib/python2.6/site-packages/binary_agilo-1.3.8_PRO-py2.6.egg/agilo/ticket/model.py", line 807, in _check_business_rules
    RuleEngine(self.env).validate_rules(self)
  File "/opt/bitnami/python/lib/python2.6/site-packages/binary_agilo-1.3.8_PRO-py2.6.egg/agilo/scrum/workflow/api.py", line 61, in validate_rules
    debug(self, "Called validate_rules(%s)" % ticket)
  File "/opt/bitnami/python/lib/python2.6/site-packages/binary_agilo-1.3.8_PRO-py2.6.egg/agilo/ticket/model.py", line 298, in __str__
    repr(self.get_type()))
TypeError: %d format: a number is required, not unicode  

Reason: Agilo wraps Trac's ticket/model.py and uses the ticket id in transforming it to a string. In some cases the ticket is retrieved as a unicode literal (i.e. u'1' instead of an integer, causing the above error.

Fix: Make sure the id is passed on to the ticket instance as an integer. Patch attached.

Attachments (1)

gridmod_agilo_ticket_patch.diff (1.4 KB) - added by ps@… 12 years ago.
Patch to pass ticket id as integer

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by ps@…

Patch to pass ticket id as integer

comment:1 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

(In [12223]) Fixes #10506: Cast ticket ID to an int before passing to the Ticket constructor to avoid an exception with AgiloTrac. Thanks to ps@… for the patch.

comment:2 in reply to:  description Changed 12 years ago by Ryan J Ollos

Replying to ps@novapp.ch:

[...]

http://trac.domain.ch/trac/Project/gridmod/update?_=1350658481047&ticket=1&component=SomeComp

The _=1350658481047 in the URL must come from Agilo, right?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Björn Harrtell.
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.