0

I cannot access carrier, stock and warehouse from BO, it threws this kind of error and I don't understand what this error is all about. Kindly please guide me because I'm quite new with prestashop. Please refer to the image link below to see the error:

image.png

[PrestaShopDatabaseException] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 2

SELECT * FROM ps_hook_module_exceptions WHERE id_shop IN ()

at line 791 in file classes/db/Db.php

  1. if ($webservice_call && $errno) {
  2. $dbg = debug_backtrace();
  3. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
  4. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
  5. if ($sql) {
  6. throw new PrestaShopDatabaseException($this->getMsgError().'

    '.$sql.'
    ');
  7. }
    1. throw new PrestaShopDatabaseException($this->getMsgError());
  8. }
  9. }

DbCore->displayError - [line 425 - classes/db/Db.php] - [1 Arguments]

  1. $this->result = $this->_query($sql);
  2. }
  3. }
    1. if (_PS_DEBUG_SQL_) {
  4. $this->displayError($sql);
  5. }
    1. return $this->result;
  6. }
  7. 430.

Argument [0]

SELECT * FROM ps_hook_module_exceptions WHERE id_shop IN ()

DbCore->query - [line 643 - classes/db/Db.php] - [1 Arguments]

  1. throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
  2. }
  3. return $this->execute($sql, $use_cache);
  4. }
    1. $this->result = $this->query($sql);
    1. if (!$this->result) {
  5. $result = false;
  6. } else {
  7. if (!$array) { Argument [0]

SELECT * FROM ps_hook_module_exceptions WHERE id_shop IN ()

DbCore->executeS - [line 2142 - classes/module/Module.php] - [2 Arguments]

  1. if (!Cache::isStored($cache_id)) {
  2. $exceptions_cache = array();
  3. $sql = 'SELECT * FROM '._DB_PREFIX_.'hook_module_exceptions
  4. WHERE id_shop IN ('.implode(', ', Shop::getContextListShopID()).')';
  5. $db = Db::getInstance();
  6. $result = $db->executeS($sql, false);
  7. while ($row = $db->nextRow($result)) {
  8. if (!$row['file_name']) {
  9. continue;
  10. }
  11. $key = $row['id_hook'].'-'.$row['id_module'];

Argument [0]

SELECT * FROM ps_hook_module_exceptions WHERE id_shop IN () Argument 1

ModuleCore::getExceptionsStatic - [line 495 - classes/Hook.php] - [2 Arguments] 490. continue; 491. } 492. 493. // Check permissions 494. if ($check_exceptions) { 495. $exceptions = Module::getExceptionsStatic($array['id_module'], $array['id_hook']); 496. 497. $controller = Dispatcher::getInstance()->getController(); 498. $controller_obj = Context::getContext()->controller; 499. 500. //check if current controller is a module controller Argument [0] 63 Argument 1 57

HookCore::exec - [line 2749 - classes/controller/AdminController.php] - [2 Arguments]

  1. 'host_mode' => defined('_PS_HOST_MODE_') ? 1 : 0,
  2. 'stock_management' => (int)Configuration::get('PS_STOCK_MANAGEMENT')
  3. ));
    1. if ($this->display_header) {
  4. $this->context->smarty->assign('displayBackOfficeHeader', Hook::exec('displayBackOfficeHeader', array()));
  5. }
    1. $this->context->smarty->assign(array(
  6. 'displayBackOfficeTop' => Hook::exec('displayBackOfficeTop', array()),
  7. 'submit_form_ajax' => (int)Tools::getValue('submitFormAjax') Argument [0] displayBackOfficeHeader Argument 1 Array ( )

AdminControllerCore->init - [line 170 - classes/controller/Controller.php]

  1. /**
    • Starts the controller process (this method should not be overridden!)
  2. */
  3. public function run()
  4. {
  5. $this->init();
  6. if ($this->checkAccess()) {
  7. // setMedia MUST be called before postProcess
  8. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
  9. $this->setMedia();
  10. }

ControllerCore->run - [line 367 - classes/Dispatcher.php]

  1. if (isset($params_hook_action_dispatcher)) {
  2. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
  3. }
    1. // Running controller
  4. $controller->run();
  5. } catch (PrestaShopException $e) {
  6. $e->displayMessage();
  7. }
  8. }
  9. 372.

DispatcherCore->dispatch - [line 58 - admin/index.php]

  1. if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) {
  2. $_REQUEST['controller'] = strtolower($_REQUEST['tab']);
  3. }
    1. // Prepare and trigger admin dispatcher
  4. Dispatcher::getInstance()->dispatch();

0 Answers0