Hello
I'm using osTicket 1.14.1 with php 7.3 for 4 months.
Yesterday I started getting those error messages
How can I resolve this error?
[SELECT COUNT(DISTINCT CASE WHEN A1.ticket_id= Z1.ticket_idTHEN A1.ticket_idEND) ASq25, COUNT(DISTINCT CASE WHEN A2.idIN (1) AND A2.state= 'open' AND A1.dept_idIN (12, 9, 13, 5, 11) AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq21, COUNT(DISTINCT CASE WHEN A2.idIN (1) AND A2.state= 'open' AND NOT A1.dept_id= 5 AND A1.createdIS NOT NULL AND A1.est_duedateIS NOT NULL AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq19, COUNT(DISTINCT CASE WHEN A2.state= 'closed' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq8, COUNT(DISTINCT CASE WHEN A2.state= 'closed' AND A2.state= 'closed' AND A1.closedBETWEEN '2020-10-27 00:00:00' AND '2020-10-27 23:59:59' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq9, COUNT(DISTINCT CASE WHEN A2.state= 'closed' AND A2.state= 'closed' AND A1.closedBETWEEN '2020-10-26 00:00:00' AND '2020-10-26 23:59:59' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq10, COUNT(DISTINCT CASE WHEN A2.state= 'closed' AND A2.state= 'closed' AND A1.closedBETWEEN '2020-10-26 00:00:00' AND '2020-11-01 23:59:59' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq11, COUNT(DISTINCT CASE WHEN A2.state= 'closed' AND A2.state= 'closed' AND A1.closedBETWEEN '2020-10-01 00:00:00' AND '2020-10-31 23:59:59' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq12, COUNT(DISTINCT CASE WHEN A2.state= 'closed' AND A2.state= 'closed' AND A1.closedBETWEEN '2020-10-01 00:00:00' AND '2020-12-31 23:59:59' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq13, COUNT(DISTINCT CASE WHEN A2.state= 'closed' AND A2.state= 'closed' AND A1.closedBETWEEN '2020-01-01 00:00:00' AND '2020-12-31 23:59:59' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq14, COUNT(DISTINCT CASE WHEN A2.state= 'open' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq1, COUNT(DISTINCT CASE WHEN A2.state= 'open' AND A2.state= 'open' AND A1.isanswered= '0' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq2, COUNT(DISTINCT CASE WHEN A2.state= 'open' AND A2.state= 'open' AND A1.isanswered= '1' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq3, COUNT(DISTINCT CASE WHEN A2.state= 'open' AND A2.state= 'open' AND A1.isoverdue= '1' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq4, COUNT(DISTINCT CASE WHEN A1.staff_idIN (4) AND A2.state= 'open' AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq5, COUNT(DISTINCT CASE WHEN A1.staff_idIN (4) AND A2.state= 'open' AND A1.staff_idIN (4) AND A2.state= 'open' AND A1.staff_idIN (4) AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq6, COUNT(DISTINCT CASE WHEN A1.staff_idIN (4) AND A2.state= 'open' AND A1.staff_idIN (4) AND A2.state= 'open' AND NOT A1.staff_idIN (4) AND A3.object_type= 'T' THEN A1.ticket_idEND) ASq7FROMost_ticketA1 JOINost_ticket_statusA2 ON (A1.status_id= A2.id) LEFT JOINost_threadA3 ON (A3.object_type= 'T' AND A1.ticket_id= A3.object_id) LEFT JOINost_thread_referralA4 ON (A3.id= A4.thread_id) LEFT JOINost_staffA5 ON (A4.object_type= 'S' AND A4.object_id= A5.staff_id) LEFT JOINost_threadA6 ON (A1.ticket_id= A6.object_idAND A6.object_type= 'C') LEFT JOINost_thread_referralA7 ON (A6.id= A7.thread_id) LEFT JOINost_staffA8 ON (A7.object_type= 'S' AND A7.object_id= A8.staff_id) LEFT JOINost_departmentB0 ON (A4.object_type= 'D' AND A4.object_id= B0.id) LEFT JOINost_departmentB1 ON (A7.object_type= 'D' AND A7.object_id= B1.id) WHERE ((A2.state= 'open' AND (A1.staff_id= 4 OR A5.staff_id= 4 OR A6.object_type= 'C' AND A8.staff_id= 4)) OR (A2.stateIN ('open', 'closed') AND (A1.dept_idIN (4) OR B0.idIN (4))) OR A6.object_type= 'C' AND B1.id` IN (4))]

Unknown column 'Z1.ticket_id' in 'field list'<br />
<br />
---- Stega bakåt ----<br />
#0 (root)/include/mysqli.php(200): osTicket->logDBError('DB Error #1054', '[SELECT COUNT(D...')<br />
#1 (root)/include/class.orm.php(3459): db_query('SELECT COUNT(DI...', true, true)<br />
#2 (root)/include/class.orm.php(3506): MySqlExecutor->execute()<br />
#3 (root)/include/class.orm.php(2093): MySqlExecutor->getArray()<br />
#4 (root)/include/class.orm.php(2043): HashArrayIterator->{closure}()<br />
#5 (root)/include/class.orm.php(2022): CallbackSimpleIterator->next()<br />
#6 (root)/include/class.orm.php(2031): CallbackSimpleIterator->rewind()<br />
#7 (root)/include/class.orm.php(1703): CallbackSimpleIterator->valid()<br />
#8 (root)/include/class.orm.php(1713): CachedResultSet->fillTo(9223372036854775807)<br />
#9 (root)/include/class.orm.php(1336): CachedResultSet->asArray()<br />
#10 (root)/include/class.orm.php(1359): QuerySet->all()<br />
#11 (root)/include/class.search.php(973): QuerySet->one()<br />
#12 (root)/include/class.search.php(905): SavedQueue::counts(Object(StaffSession), true)<br />
#13 (root)/include/staff/templates/queue-tickets.tmpl.php(111): SavedQueue->getCount(Object(StaffSession))<br />
#14 (root)/scp/tickets.php(577): require_once('(root)/i...')<br />
#15 {main}
`

Your custom queue #25 has an issue. You can delete and recreate it and the error should go away.

@pwned

Login to the database, go to the ost_queue table, and delete the record with id = 25. Then you can go to the ost_queue_columns, ost_queue_config, ost_queue_export, and ost_queue_sorts tables and delete the records where queue_id = 25. Then you should be good to go.

Cheers.

Write a Reply...