Skip to content

Pro Search - Deprecation error when saving Shortcuts #3127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CreativePoweredGeek opened this issue Mar 16, 2023 · 0 comments · Fixed by #3145
Closed

Pro Search - Deprecation error when saving Shortcuts #3127

CreativePoweredGeek opened this issue Mar 16, 2023 · 0 comments · Fixed by #3145
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Comments

@CreativePoweredGeek
Copy link

Description of the problem

When saving a shortcut from the Search Log. a Deprecation error occurs

How To Reproduce
Steps to reproduce the behavior:
Run a search
Go to the Search Log, Click the Save Shortcut button

Error Messages

 Deprecated
trim(): Passing null to parameter #1 ($string) of type string is deprecated
ee/ExpressionEngine/Addons/pro_search/models/pro_search_shortcut_model.php, line 184

Severity: E_DEPRECATED
Exception Caught
SQLSTATE[HY000]: General error: 1364 Field 'sort_order' doesn't have a default value:
INSERT INTO `exp_pro_search_shortcuts` (`shortcut_id`, `site_id`, `group_id`, `shortcut_name`, `shortcut_label`, `parameters`) VALUES (NULL, '1', '2', 'air-filters', 'Air Filters', '{\"result_page\":\"ajax\\/product-search-results\",\"search:class\":\"KA-PROD|KA-PURCH|KC-PROD|KC-PURCH|KS-PROD|KS-PURCH\"}')
ee/legacy/database/drivers/mysqli/mysqli_connection.php:114

Stack Trace: Please include when reporting this error
#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query('INSERT INTO `ex...')
#1 ee/legacy/database/DB_driver.php(260): CI_DB_mysqli_driver->_execute('INSERT INTO `ex...')
#2 ee/legacy/database/DB_driver.php(175): CI_DB_driver->simple_query('INSERT INTO `ex...')
#3 ee/legacy/database/DB_active_rec.php(1297): CI_DB_driver->query('INSERT INTO `ex...')
#4 ee/ExpressionEngine/Addons/pro_search/model.pro_search.php(214): CI_DB_active_record->insert('exp_pro_search_...', Array)
#5 ee/ExpressionEngine/Addons/pro_search/mcp.pro_search.php(2030): Pro_search_model->insert(Array)
#6 [internal function]: Pro_search_mcp->save_shortcut()
#7 ee/ExpressionEngine/Controller/Addons/Addons.php(1590): call_user_func_array(Array, Array)
#8 ee/ExpressionEngine/Controller/Addons/Addons.php(866): ExpressionEngine\Controller\Addons\Addons->getModuleSettings('pro_search', 'save_shortcut', Array)
#9 [internal function]: ExpressionEngine\Controller\Addons\Addons->settings('pro_search', 'save_shortcut')
#10 ee/ExpressionEngine/Core/Core.php(268): call_user_func_array(Array, Array)
#11 ee/ExpressionEngine/Core/Core.php(124): ExpressionEngine\Core\Core->runController(Array)
#12 ee/ExpressionEngine/Boot/boot.php(184): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#13 admin.php(153): require_once('...')
#13 admin.php(153): require_once('...') 


Screenshots / Videos / Template Code

Environment Details:

  • Version: EE 7.2.11
  • PHP Version 8.1.16
  • MySQL Version [e.g. 5.7]
  • OS: [e.g. Linux, macOS, Windows]
  • Web Server: Apache

Possible Solution

Additional context

@intoeetive intoeetive added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Mar 20, 2023
intoeetive added a commit that referenced this issue Mar 20, 2023
intoeetive added a commit that referenced this issue Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
2 participants