Page 1 of 1
SQL error merging tickets
Posted: Thu Jun 14, 2018 1:22 pm
by xbach
Version of script: 2.8.1
Write your message below:
Hi again. I must have another error in database because when I try to merge two or more tickets it shows me an SQL generic error.
I've looked at database and I see it converts tickets to replies, but it doesn't update ticket `merged` info, so it does not show merged tickets as reply.
Can you help me please?
Thanks a lot!
Re: SQL error merging tickets
Posted: Thu Jun 14, 2018 2:30 pm
by mkoch227
If you enable debug mode in settings, the error message should display the SQL query and why the query failed to execute. Try enabling debug mode, merge some tickets, and if there is an error, share the full error here.
Re: SQL error merging tickets
Posted: Fri Jun 15, 2018 6:45 am
by xbach
Thanks for your reply mkoch227, but enabling debug mode the SQL error is still generic.
It only says "Can't execute SQL"
Any workaround?
Thank you!
Re: SQL error merging tickets
Posted: Fri Jun 15, 2018 6:51 am
by Klemen
Debug mode isn't enabled if all you see is the "Can't execute SQL". Or are you running a mod, not original Hesk?
Make 100% sure you enable it: Admin panel > Settings > Help desk tab > under "Features" make sure "Debug mode:" is ON and then Save changes.
Re: SQL error merging tickets
Posted: Fri Jun 15, 2018 9:59 am
by xbach
You are right Klemen. It was my mistake.
The SQL output I get is this:
Can't execute SQL: SELECT COUNT(*) as `cnt`, `staffid` FROM `hesk_replies` WHERE `replyto`=14577 GROUP BY CASE WHEN `staffid` = 0 THEN 0 ELSE 1 END ASC
MySQL said:
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'hesk.hesk_replies.staffid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Thanks for your attention
Re: SQL error merging tickets
Posted: Fri Jun 15, 2018 11:17 am
by Klemen
Seems like MySQL's ONLY_FULL_GROUP_BY mode doesn't like the way that query is structured. We learn something new every day...
Try uploading this "admin_functions.inc.php" file to your "inc" folder (overwrite exiting file) and see if that fixes your problem:
https://hesk.com/extras/hesk281_group_by.zip
Did it do the trick?
Re: SQL error merging tickets
Posted: Fri Jun 15, 2018 12:54 pm
by xbach
It worked!
You're the master

Thank you very much!
Re: SQL error merging tickets
Posted: Fri Jun 15, 2018 1:27 pm
by xbach
Excuse me, but now, with the file you told me to change I find some untraslated strings.
For example: the status of the ticket now is in English, but my language is set to catalan.
May it be something in the file you sent me?
Thanks again
Re: SQL error merging tickets
Posted: Fri Jun 15, 2018 2:25 pm
by Klemen
That file doesn't change anything language related.
Try clearing the cache by going to Admin panel > Settings and click "Save changes" at the bottom.
Re: SQL error merging tickets
Posted: Mon Jun 18, 2018 6:38 am
by xbach
Thanks again Klemen!
It worked!
Best regards