Page 1 of 1

MySql error

Posted: Mon Jul 11, 2016 8:15 am
by Underscorex3
Hello,

I am a huge fan of HESK and lately my IT department is making some changes in their way of working and organizing tickets. Thats when we started using HESK. They came to me with a request if it was possible to add a default value to the required email adress field so our customers only have to put there names in the field (Example email adres: pascalle.vanderpol@bibliotheekrivierenland.nl). I am not familiair with PHP but I tried my best and eventually found the field I needed and added a value. At first everything seem to look fine but when I tried to submit a ticket I got the following error:

Error:
Can't execute SQL: INSERT INTO `hesk_stage_tickets` ( `trackid`, `name`, `email`, `category`, `priority`, `subject`, `message`, `dt`, `lastchange`, `articles`, `ip`, `language`, `openedby`, `owner`, `attachments`, `merged`, `history`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`, `custom11`, `custom12`, `custom13`, `custom14`, `custom15`, `custom16`, `custom17`, `custom18`, `custom19`, `custom20`, `status`, `latitude`, `longitude`, `html`, `user_agent`, `screen_resolution_height`, `screen_resolution_width`, `due_date` ) VALUES ( 'W4M-3EJ-MPXL', 'Yola Brink', 'test@bibliotheekrivierenland.nl', '1', '3', 'Test', 'Test', NOW(), NOW(), NULL, '::1', 'English', '0', '0', '', '', '
2016-07-11 10:35:39 | submitted by Yola Brink
', 'Tiel', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0', 'E-0', 'E-0', '0', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36', 1200, 1920, NULL )
MySQL said:
Unknown column 'due_date' in 'field list'

WARNING
Debug mode is enabled. Make sure you disable debug mode in settings once HESK is installed and working properly.

Notice: Undefined index: due_date in C:\xampp\htdocs\helpdesk\inc\posting_functions.inc.php on line 58

I added the value in the index.php on line 221 and it looks like this now:

Code: Select all

<div class="col-sm-9">
                        <input type="text" class="form-control" id="email" name="email" size="40" maxlength="1000" value="@bibliotheekrivierenland.nl"
Can someone please help me with this issue?
Best Regards,
P. van der Pol

Re: MySql error

Posted: Mon Jul 11, 2016 11:26 am
by mkoch227
Based on the columns in the SQL statement, it looks like you're using Mods for HESK (or used to use it, but never properly uninstalled it). If you're still using Mods for HESK, make sure you have properly updated your database to the latest version (2.6.1).

Re: MySql error

Posted: Wed Jul 13, 2016 11:21 am
by Underscorex3
Hello mkoch227,

Thank you for you're answer. According to the information in the settings, HESK is running on the latest version. I tried to update the database but that didn't work because we are already running on 2.6.1

I am afraid to ask but do you have any more idea's to save our project?

Best Regards,
P. van der Pol

Re: MySql error

Posted: Wed Jul 13, 2016 2:44 pm
by mkoch227
You can add the column manually by running the following SQL statement against your HESK database (using something like phpMyAdmin):

Code: Select all

ALTER TABLE `hesk_stage_tickets` ADD COLUMN `due_date` DATETIME
However, since you're missing this column, I'm concerned that something went wrong during the install and you might be missing other columns. If you want me to verify your database, feel free to send me a backup of your database to me via private message (you'll need to upload the backup somewhere since you can't attach anything in PMs).

Re: MySql error

Posted: Thu Jul 14, 2016 4:09 pm
by mkoch227
Thanks for your backup; I now know what happened. I forgot to add the two new columns to the stage_tickets table, so the due date can't be set. To fix this, run these two queries against your database (using phpMyAdmin or similar):

Code: Select all

ALTER TABLE `hesk_stage_tickets` ADD COLUMN `due_date` DATETIME
ALTER TABLE `hesk_stage_tickets` ADD COLUMN `overdue_email_sent` ENUM('0','1') NOT NULL DEFAULT '0'
NOTE: If you make this change manually, the 2.6.2 install will fail since the columns already exist. It's recommended to disable the email verification feature until the fix is released.

Not too many people use the email verification feature which is why the issue wasn't discovered earlier :lol: