Duplicate entry '0-0-0-0' for key 'PRIMARY'INSERT INTO `ps_guest` (`id_operating_system`, `id_web_browser`, `id_customer`, `javascript`, `screen_resolution_x`, `screen_resolution_y`, `screen_color`, `sun_java`, `adobe_flash`, `adobe_director`, `apple_quicktime`, `real_player`, `windows_media`, `accept_language`, `mobile_theme`) VALUES ('0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'en', '0')
at line 791 in file classes/db/Db.php
786. if ($webservice_call && $errno) {
787. $dbg = debug_backtrace();
788. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
789. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
790. if ($sql) {
791. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
792. }
793.
794. throw new PrestaShopDatabaseException($this->getMsgError());
795. }
796. }
420. $this->result = $this->_query($sql);
421. }
422. }
423.
424. if (_PS_DEBUG_SQL_) {
425. $this->displayError($sql);
426. }
427.
428. return $this->result;
429. }
430.
758. if ($sql instanceof DbQuery) {
759. $sql = $sql->build();
760. }
761.
762. $this->result = false;
763. $result = $this->query($sql);
764. if ($use_cache && $this->is_cache_enabled) {
765. Cache::getInstance()->deleteQuery($sql);
766. }
767.
768. if (_PS_DEBUG_SQL_) {
509. $sql = $insert_keyword.' INTO `'.$table.'` ('.$keys_stringified.') VALUES '.implode(', ', $values_stringified);
510. if ($type == Db::ON_DUPLICATE_KEY) {
511. $sql .= ' ON DUPLICATE KEY UPDATE '.substr($duplicate_key_stringified, 0, -1);
512. }
513.
514. return (bool)$this->q($sql, $use_cache);
515. }
516.
517. /**
518. * Executes an UPDATE query
519. *
482.
483. // Database insertion
484. if (Shop::checkIdShopDefault($this->def['table'])) {
485. $this->id_shop_default = (in_array(Configuration::get('PS_SHOP_DEFAULT'), $id_shop_list) == true) ? Configuration::get('PS_SHOP_DEFAULT') : min($id_shop_list);
486. }
487. if (!$result = Db::getInstance()->insert($this->def['table'], $this->getFields(), $null_values)) {
488. return false;
489. }
490.
491. // Get object id in database
492. $this->id = Db::getInstance()->Insert_ID();
440. * @return bool Insertion result
441. * @throws PrestaShopException
442. */
443. public function save($null_values = false, $auto_date = true)
444. {
445. return (int)$this->id > 0 ? $this->update($null_values) : $this->add($auto_date, $null_values);
446. }
447.
448. /**
449. * Adds current object to the database
450. *
188.
189. public static function setNewGuest($cookie)
190. {
191. $guest = new Guest(isset($cookie->id_customer) ? Guest::getFromCustomer((int)($cookie->id_customer)) : null);
192. $guest->userAgent();
193. $guest->save();
194. $cookie->id_guest = (int)($guest->id);
195. }
196. }
99. }
100.
101. private function getScriptPlugins($params)
102. {
103. if (!isset($params['cookie']->id_guest)) {
104. Guest::setNewGuest($params['cookie']);
105.
106. if (Configuration::get('PS_STATSDATA_PLUGINS')) {
107. if (_PS_VERSION_ >= 1.7) {
108. $this->context->controller->registerJavascript('modules-plugindetect', 'modules/'.$this->name.'/js/plugindetect.js', array('position' => 'bottom', 'priority' => 150));
109. } else {
75. }
76.
77. public function hookFooter($params)
78. {
79. if (_PS_VERSION_ < 1.7) {
80. $script_content_plugins = $this->getScriptPlugins($params);
81. $script_content_pages_views = $this->getScriptCustomerPagesViews($params);
82.
83. return $script_content_plugins . $script_content_pages_views;
84. }
85.
586. }
587. }
588.
589. // Immediately return the result if we do not log performances
590. if (!Module::$_log_modules_perfs) {
591. return $module->{$method}($params);
592. }
593.
594. // Store time and memory before and after hook call and save the result in the database
595. $time_start = microtime(true);
596. $memory_start = memory_get_usage(true);
543.
544. // Call hook method
545. if ($hook_callable) {
546. $display = Hook::coreCallHook($moduleInstance, 'hook'.$hook_name, $hook_args);
547. } elseif ($hook_retro_callable) {
548. $display = Hook::coreCallHook($moduleInstance, 'hook'.$retro_hook_name, $hook_args);
549. }
550.
551. // Live edit
552. if (!$array_return && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad')
553. && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'
1017. * Initializes page footer variables
1018. */
1019. public function initFooter()
1020. {
1021. $this->context->smarty->assign(array(
1022. 'HOOK_FOOTER' => Hook::exec('displayFooter'),
1023. 'conditions' => Configuration::get('PS_CONDITIONS'),
1024. 'id_cgv' => Configuration::get('PS_CONDITIONS_CMS_ID'),
1025. 'PS_SHOP_NAME' => Configuration::get('PS_SHOP_NAME'),
1026. 'PS_ALLOW_MOBILE_DEVICE' => isset($_SERVER['HTTP_USER_AGENT']) && (bool)Configuration::get('PS_ALLOW_MOBILE_DEVICE') && @filemtime(_PS_THEME_MOBILE_DIR_)
1027. ));
190. } else {
191. $this->errors[] = Tools::displayError('Access denied.');
192. }
193.
194. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
195. $this->initFooter();
196. }
197.
198. // Default behavior for ajax process is to use $_POST[action] or $_GET[action]
199. // then using displayAjax[action]
200. if ($this->ajax) {
362. if (isset($params_hook_action_dispatcher)) {
363. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
364. }
365.
366. // Running controller
367. $controller->run();
368. } catch (PrestaShopException $e) {
369. $e->displayMessage();
370. }
371. }
372.
23. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24. * International Registered Trademark & Property of PrestaShop SA
25. */
26.
27. require(dirname(__FILE__).'/config/config.inc.php');
28. Dispatcher::getInstance()->dispatch();