Trouble with Updated column not updating always

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
uncle_giavelli
Posts: 3
Joined: Wed Sep 22, 2010 12:21 am

Trouble with Updated column not updating always

Post 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
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Trouble with Updated column not updating always

Post by Klemen »

You are right, thanks for reporting this.

And yes, adding `lastchange`=NOW() should fix it and will be included in 2.5
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Trouble with Updated column not updating always

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
uncle_giavelli
Posts: 3
Joined: Wed Sep 22, 2010 12:21 am

Re: Trouble with Updated column not updating always

Post by uncle_giavelli »

Thank you so much. As always you are the best.

J
Post Reply