Page 1 of 1

Trouble with Updated column not updating always

Posted: Wed Mar 27, 2013 6:01 pm
by uncle_giavelli
Script URL:
Version of script: 2.4.2
Hosting company: self hosted
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: Updated column, lastchange

Write your message below:

Klemen,

Since updating to version 2.4.2 from version 2.3 we have noticed that in some cases the Updated column does not update when another response is added to a ticket. Today this annoyance made me find the time to locate the issue. The trouble is when two responses in a row are made by the original submitter. Setting lastchange equaling NOW() was removed for some reason between versions 2.3 and 2.4.2 or maybe even 2.4.

reply_ticket.php => line 140 => $sql = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` SET `status`='1',`lastreplier`='0' WHERE `id`=".hesk_dbEscape($ticket['id'])." LIMIT 1";

admin/admin_ticket.php => line 207 => $sql = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` SET `lastchange`=NOW(), `lastreplier`='".hesk_dbEscape($last_replier)."', `replierid`=".hesk_dbEscape($replier_id)." $status_sql WHERE `id`=".hesk_dbEscape($ticket['id'])." LIMIT 1";

The trouble occurs as I've said when the original submitter responds twice to a ticket. The UPDATE sql is smart enough to know that no changes occur and therefore does not update the lastchange column in the tickets table. I'm adding the SET `lastchange`=NOW() into the reply_ticket.php file. What I'm wondering is will this break something else I'm not seeing at the moment?

We love Hesk and enjoy your continued support!

J

Re: Trouble with Updated column not updating always

Posted: Wed Mar 27, 2013 7:05 pm
by Klemen
You are right, thanks for reporting this.

And yes, adding `lastchange`=NOW() should fix it and will be included in 2.5

Re: Trouble with Updated column not updating always

Posted: Wed Mar 27, 2013 7:08 pm
by Klemen
P.s.: if you are using email piping the same change needs to be done in inc/pipe_functions.inc.php, line 222

Re: Trouble with Updated column not updating always

Posted: Wed Mar 27, 2013 7:24 pm
by uncle_giavelli
Thank you so much. As always you are the best.

J