Modify ↓
Opened 15 years ago
Closed 15 years ago
#5843 closed defect (fixed)
RPC XML Plugin result with warnings
Reported by: | Owned by: | osimons | |
---|---|---|---|
Priority: | highest | Component: | XmlRpcPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description (last modified by )
When I try to resolve action arise warning and trac returns an error
2009-09-18 13:06:49,203 Trac[web_ui] ERROR: add_warning 2009-09-18 13:06:49,204 Trac[web_ui] ERROR: Traceback (most recent call last): File "/usr/local/lib/python2.6/site-packages/TracXMLRPC-1.0.6-py2.6.egg/tracrpc/web_ui.py", line 182, in process_xml_request result = XMLRPCSystem(self.env).get_method(method)(req, args) File "/usr/local/lib/python2.6/site-packages/TracXMLRPC-1.0.6-py2.6.egg/tracrpc/api.py", line 94, in __call__ result = self.callable(req, *args) File "/usr/local/lib/python2.6/site-packages/TracXMLRPC-1.0.6-py2.6.egg/tracrpc/ticket.py", line 191, in update req.add_warning("Rpc ticket.update: %(warning)s", File "/usr/local/lib/python2.6/site-packages/Trac-0.11.5-py2.6.egg/trac/web/api.py", line 198, in __getattr__ raise AttributeError(name) AttributeError: add_warning
Attachments (0)
Change History (4)
comment:1 Changed 15 years ago by
Priority: | normal → highest |
---|
comment:2 Changed 15 years ago by
This patch should hopefully fix it:
-
trunk/tracrpc/ticket.py
a b 15 15 from trac.ticket.api import TicketSystem 16 16 from trac.ticket.notification import TicketNotifyEmail 17 17 from trac.ticket.web_ui import TicketModule 18 from trac.web.chrome import add_warning 18 19 from trac.util.datefmt import to_datetime, to_timestamp, utc 19 20 20 21 import genshi … … 188 189 req.args['ts'] = str(t.time_changed) # collision hack... 189 190 changes, problems = tm.get_ticket_changes(req, t, action) 190 191 for warning in problems: 191 req.add_warning("Rpc ticket.update: %(warning)s",192 add_warning(req, "Rpc ticket.update: %(warning)s", 192 193 warning=warning) 193 194 valid = problems and False or tm._validate_ticket(req, t) 194 195 if not valid:
Can you verify, please?
comment:3 Changed 15 years ago by
Description: | modified (diff) |
---|
That patch did not work for me. Below is a slightly modified version that I have tested against Trac 0.11.5 but I could not figure out where the warning actually end up. On a related note, the bug currently causes ticket updates to fail in certain scenarios:
289945: Mylin Trac fails to submit a ticket with actions other than "Resolve Fixed" https://bugs.eclipse.org/bugs/show_bug.cgi?id=289945
Index: trunk/tracrpc/ticket.py =================================================================== --- trunk/tracrpc/ticket.py (revision 6568) +++ trunk/tracrpc/ticket.py (working copy) @@ -15,6 +15,7 @@ from trac.ticket.api import TicketSystem from trac.ticket.notification import TicketNotifyEmail from trac.ticket.web_ui import TicketModule +from trac.web.chrome import add_warning from trac.util.datefmt import to_datetime, to_timestamp, utc import genshi @@ -188,8 +189,7 @@ req.args['ts'] = str(t.time_changed) # collision hack... changes, problems = tm.get_ticket_changes(req, t, action) for warning in problems: - req.add_warning("Rpc ticket.update: %(warning)s", - warning=warning) + add_warning(req, "Rpc ticket.update: %s" % (warning)) valid = problems and False or tm._validate_ticket(req, t) if not valid: raise TracError(
comment:4 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [6598]) XmlRpcPlugin: Warnings added in wrong (non-functional) way. Closes #5843.
Note: See
TracTickets for help on using
tickets.
Not good, as
req.add_warning()
obviously does not exist - even I know that :-) Either it isadd_warning(req, msg)
or I'm trying to do something else. I'll have a look at the code and see what I'm actually wanting to do - and fix this shortly (hopefully).