Changes between Initial Version and Version 7 of Ticket #7496


Ignore:
Timestamp:
Apr 7, 2013 12:31:53 AM (19 months ago)
Author:
hasienda
Comment:

Replying to dwc:

In case it's helpful, here is a more permanent link to the referenced patch:

Thanks for taking care. But the most "permanent" way to provide the patch, would have been to attach a patch file to this ticket, or just inline the patch into the description, so it is really self-contained and not relying on external resources. I've done so for you now.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7496

    • Property Status changed from new to closed
    • Property Cc jun66j5 hasienda added
    • Property Resolution changed from to fixed
    • Property Owner changed from k0s to rjollos
  • Ticket #7496 – Description

    initial v7  
    99A simple fix is to quote the value in the SQL statement.  This works on PostgreSQL and SQLite databases.
    1010
    11 http://github.com/dwc/dwc-overlay/blob/master/dev-python/trac-ticket-mover/files/trac-ticket-mover-sql-quoting.patch
     11{{{
     12#!diff
     13Index: 0.11/ticketmoverplugin/ticketmover.py
     14===================================================================
     15--- 0.11/ticketmoverplugin/ticketmover.py       (revision 8362)
     16+++ 0.11/ticketmoverplugin/ticketmover.py       (working copy)
     17@@ -188,7 +188,7 @@
     18 
     19         # copy the changelog and attachment DBs
     20         for table, _id in tables.items():
     21-            for row in get_all_dict(self.env, "SELECT * FROM %s WHERE %s=%s" % (table, _id, ticket_id)):
     22+            for row in get_all_dict(self.env, "SELECT * FROM %s WHERE %s = '%s'" % (table, _id, ticket_id)):
     23                 row[_id] = new_ticket.id
     24                 insert_row_from_dict(env, table, row)
     25 
     26}}}