Uncaught exception received when searching

When performing search in GFI HelpDesk, the following exception can be received sometimes:

Uncaught Exception AutoExecute Query: AutoExecute Query:

INSERT swsearchstores

(array

(

'sessionid' => 'gM7CPU9K09lWAIB1ydsF1d2d25e4faeaffe89849e1912350626bd7a1a147RKFwmO8TT6Dtt',

'storetype' => 5, 'dateline' => 1557820459, 'lastupdate' => 1557820459, 'staffid' => '112', 'userid' => false,

)

)

in ./__swift/library/Database/class.SWIFT_Database.php:603

This is because MySQL Strict Mode is enabled by default and should be disabled to use GFI HelpDesk.

The recommended resolution for this is to Disable MySQL Strict Mode at the server level.

Alternatively, you can disable MySQL Strict Mode at the session level.

Note:
  • This configuration ensures that every time GFI HelpDesk wants to connect to the MySQL Database, Strict Mode is disabled at the session level.
  • The user must have the necessary permissions on the database to disable Strict Mode.

Follow the below steps to disable MySQL Strict Mode at the session level:

  1. Launch a text editor.
  2. Open the file: __swift/library/Database/class.SWIFT_Database.php
  3. Find the method __construct()
  4. At the end of that method, just before the line: return parent::__construct(), add the following line of code:
    $this->Execute("SET SESSION sql_mode=''");
  5. At the end of that method, just after the line: return parent::__construct(), add the following code:
    if(defined('DISABLE_MYSQL_STRICT_SESSION') && DISABLE_MYSQL_STRICT_SESSION) {

    $result = $this->Execute("SET SESSION sql_mode=''");

    }

  6. It should look like this in a code enabled text editor

  7. Restart the MySQL services.

Perform the search action again to confirm the exception is no longer received.