Duplicate entry '0' for key 'PRIMARY'INSERT INTO `pg9dvtbeiupage` (`id_page_type`, `id_object`) VALUES ('3', '164')
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.
Argument [0] INSERT INTO `pg9dvtbeiupage` (`id_page_type`, `id_object`) VALUES ('3', '164')
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_) {
Argument [0] INSERT INTO `pg9dvtbeiupage` (`id_page_type`, `id_object`) VALUES ('3', '164')
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. *
Argument [0] INSERT INTO `pg9dvtbeiupage` (`id_page_type`, `id_object`) VALUES ('3', '164') Argument [1] 1
77. $result = Db::getInstance()->getRow($sql);
78. if ($result['id_page']) {
79. return $result['id_page'];
80. }
81.
82. Db::getInstance()->insert('page', $insert_data, true);
83. return Db::getInstance()->Insert_ID();
84. }
85.
86. /**
87. * Return page type ID from page name
Argument [0] page Argument [1] Array ( [id_page_type] => 3 [id_object] => 164 ) Argument [2] 1
145. if (!isset($array_url['host']) || preg_replace('/^www./', '', $array_url['host']) == preg_replace('/^www./', '', Tools::getHttpHost(false, false))) {
146. $referer = '';
147. }
148. $connection = new Connection();
149. $connection->id_guest = (int)$cookie->id_guest;
150. $connection->id_page = Page::getCurrentId();
151. $connection->ip_address = Tools::getRemoteAddr() ? (int)ip2long(Tools::getRemoteAddr()) : '';
152. $connection->id_shop = Context::getContext()->shop->id;
153. $connection->id_shop_group = Context::getContext()->shop->id_shop_group;
154. $connection->date_add = $cookie->date_add;
155. if (Validate::isAbsoluteUrl($referer)) {
81. public static function setPageConnection($cookie, $full = true)
82. {
83. $id_page = false;
84. // The connection is created if it does not exist yet and we get the current page id
85. if (!isset($cookie->id_connections) || !strstr(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '', Tools::getHttpHost(false, false))) {
86. $id_page = Connection::setNewConnection($cookie);
87. }
88. // If we do not track the pages, no need to get the page id
89. if (!Configuration::get('PS_STATSDATA_PAGESVIEWS') && !Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) {
90. return array();
91. }
Argument [0]
137. }
138.
139. private function getScriptCustomerPagesViews($params)
140. {
141. // Record the guest path then increment the visit counter of the page
142. $token_array = Connection::setPageConnection($params['cookie']);
143. ConnectionsSource::logHttpReferer();
144. if (Configuration::get('PS_STATSDATA_PAGESVIEWS')) {
145. Page::setPageViewed($token_array['id_page']);
146. }
147.
Argument [0]
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.
86. return false;
Argument [0]
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);
Argument [0]
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'
Argument [0] Argument [1] hookfooter Argument [2]
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. ));
Argument [0] displayFooter
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();