Hello,

My site won't allow tickets deletion, I get this error:

============
user warning: Unknown column 'uc_ticket_tickets.ticket_id' in 'where clause' query: DELETE drupal_uc_ticket_tickets, drupal_uc_ticket_tickets_data FROM drupal_uc_ticket_tickets, drupal_uc_ticket_tickets_data WHERE uc_ticket_tickets.ticket_id = 21 AND uc_ticket_tickets_data.ticket_id = 21 in /var/www/html/drupal/sites/all/modules/uc_ticket/uc_ticket.admin.inc on line 359.
============

FYI:
When I installed drupal I set the database prefix to "drupal_" so I have drupal_uc_ticket_tickets instead of uc_ticket_tickets.

When I add the database prefix, the query runs smoothly and deletes 2 rows, here is the modified query (additions in bold text, line breaks added for clarity):
============
DELETE drupal_uc_ticket_tickets, drupal_uc_ticket_tickets_data
FROM drupal_uc_ticket_tickets, drupal_uc_ticket_tickets_data
WHERE drupal_uc_ticket_tickets.ticket_id = 14
AND drupal_uc_ticket_tickets_data.ticket_id = 14
============

Waiting for your corrections, thanks!

Cheers,
Nabil Kadimi

Comments

kadimi’s picture

Status: Active » Needs review

Hello,

I fixed it by changing the $SQL variable to :

uc_ticket.admin.inc:358

    $SQL = "DELETE {uc_ticket_tickets}, {uc_ticket_tickets_data} FROM {uc_ticket_tickets}, {uc_ticket_tickets_data} WHERE {uc_ticket_tickets}.ticket_id = %d AND {uc_ticket_tickets_data}.ticket_id = %d";

I only added a couple of {}

Anonymous’s picture

Assigned: Unassigned »

Looks like I left some brackets out. I'll have a look. thanks

Anonymous’s picture

Status: Needs review » Fixed

Fixed for tonight's dev release. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Ubercart, -uc_ticket

Automatically closed -- issue fixed for 2 weeks with no activity.