Modify

Opened 2 years ago

Closed 14 months ago

Last modified 14 months ago

#12749 closed defect (fixed)

Prevent creating ticket with empty summary

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Olemis Lang Trac Release:

Description

Trac doesn't allow creating a ticket with an empty summary through the web interface. Is there any reason that XmlRpcPlugin shouldn't enforce this constraint as well? See trac:#12458 for background.

Attachments (0)

Change History (7)

comment:1 Changed 2 years ago by osimons

No, no real reason for this. As Trac lacks any general usable API for such calls, the RPC plugin is left to re-create nuances and generally fails. There is very little validation in place, nor are ticket manipulator plugins called as part of the process. See #10738 for discussion and pointers.

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

Replying to osimons:

No, no real reason for this. As Trac lacks any general usable API for such calls, the RPC plugin is left to re-create nuances and generally fails.

I ran into similar issue while working on Bloodhound. In the near term I'll look into preparing a patch for XmlRpcPlugin, and also modify Trac so we don't get a traceback on the ticket or timeline page for a ticket with an empty summary.

comment:3 Changed 2 years ago by torsten.piotraschke@…

Same request goes for owner. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=499120

When I create a new ticket and I do not set an owner for the ticket, mylyn does not use the default user for the given component of the ticket.

comment:4 Changed 14 months ago by Ryan J Ollos

Owner: changed from osimons to Ryan J Ollos
Status: newaccepted

I'll just mention for future reference, [trac 15861#file0] (trac:#11723) moved the ticket validation into an ITicketManipulator implementation which XmlRpcPlugin could probably utilize in a future version that is only compatible with Trac 1.3.2+.

comment:5 in reply to:  3 Changed 14 months ago by Ryan J Ollos

Replying to torsten.piotraschke@…:

Same request goes for owner. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=499120

When I create a new ticket and I do not set an owner for the ticket, mylyn does not use the default user for the given component of the ticket.

See #10738.

comment:6 Changed 14 months ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 16673:

TracXMLRPC 1.1.7dev: Prevent creating ticket with empty summary

Fixes #12749.

comment:7 Changed 14 months ago by Ryan J Ollos

Tested on trac-hacks.org:

>>> p.ticket.create('', 'the description', {})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1602, in __request
    verbose=self.__verbose
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1316, in single_request
    return self.parse_response(response)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1493, in parse_response
    return u.close()
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 800, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "'Tickets must contain a summary.' while executing 'ticket.create()'">

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.