SQL error merging tickets

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
xbach
Posts: 23
Joined: Tue Aug 17, 2010 12:07 pm

SQL error merging tickets

Post 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!
mkoch227
Posts: 666
Joined: Wed Jul 04, 2012 3:37 pm

Re: SQL error merging tickets

Post 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.
Mike, Lead Developer of Image HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
xbach
Posts: 23
Joined: Tue Aug 17, 2010 12:07 pm

Re: SQL error merging tickets

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

Re: SQL error merging tickets

Post 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.
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
xbach
Posts: 23
Joined: Tue Aug 17, 2010 12:07 pm

Re: SQL error merging tickets

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

Re: SQL error merging tickets

Post 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?
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
xbach
Posts: 23
Joined: Tue Aug 17, 2010 12:07 pm

Re: SQL error merging tickets

Post by xbach »

It worked!
You're the master ;)
Thank you very much!
xbach
Posts: 23
Joined: Tue Aug 17, 2010 12:07 pm

Re: SQL error merging tickets

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

Re: SQL error merging tickets

Post 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.
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
xbach
Posts: 23
Joined: Tue Aug 17, 2010 12:07 pm

Re: SQL error merging tickets

Post by xbach »

Thanks again Klemen!
It worked!

Best regards
Post Reply