You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running Trac with Postgre I got this error when set a value for Parent Tickets field in the "New Ticket" page:
Trac detected an internal error:
ProgrammingError: operator does not exist: text = integer
LINE 1: SELECT parent, child FROM subtickets WHERE parent=731
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Python traceback indicates problematic lines with cusor.execute() function in files web_ui.py and api.py, like:
cursor.execute("SELECT parent, child FROM subtickets WHERE parent=%s",
(parent_id, ))
The solution found is to force casting numeric fields like parent_id or ticket_id by doing:
cursor.execute("SELECT parent, child FROM subtickets WHERE parent=%s",
(str(parent_id), ))
Don't know if this is the best approach, and I'm new in here, so I decide to report this problem and his "possible solution" as an issue.
The text was updated successfully, but these errors were encountered:
If I understand correctly, in both api.py and web_ui.py, all occurences of parent=%s and child=%s have to be single-quoted: parent='%s' and child='%s'. This seems to solve tickets #16 and #17.
Running Trac with Postgre I got this error when set a value for Parent Tickets field in the "New Ticket" page:
Python traceback indicates problematic lines with
cusor.execute()
function in filesweb_ui.py
andapi.py
, like:The solution found is to force casting numeric fields like
parent_id
orticket_id
by doing:Don't know if this is the best approach, and I'm new in here, so I decide to report this problem and his "possible solution" as an issue.
The text was updated successfully, but these errors were encountered: