params= new JRegistry(); $this->params->loadString($plugin->params, 'JSON'); $this->_cacheEnabled = $this->params->get('cache_enabled'); if ($this->_cacheEnabled === null) $this->_cacheEnabled == 1; $this->_autoflush = $this->params->get('autoFlush'); if ($this->_autoflush === null) $this->_autoflush = 1; $this->_autoflush3rdParty = $this->params->get('autoFlush-ThirdParty'); if ($this->_autoflush3rdParty === null) $this->_autoflush3rdParty = 1; $this->_autoflushClientSide = $this->params->get('autoFlush-ClientSide'); if ($this->_autoflushClientSide === null) $this->_autoflushClientSide = 0; } /** * Heartbeat cache checking function. Will also monitor $_GET for the jSGCache parameter * (pressing the purge cache button in admin) * * * @access public * @return null */ public function onAfterInitialise() { if (!$this->_cacheEnabled || $this->_isBlacklisted($this->_applicationPath)) { JResponse::setHeader('X-Cache-Enabled','False',true); return; } if ($this->_cacheEnabled) { JResponse::allowCache(true); JResponse::setHeader('X-Cache-Enabled','True',true); } //Init the application url $this->_applicationPath = str_replace(array('administrator/index.php','index.php'),'',str_replace($_SERVER['DOCUMENT_ROOT'],'',$_SERVER['SCRIPT_FILENAME'])); //Check for any admin action and proceed to flushMonitor and 3rd party plugins if ( isset($_POST['task']) || isset($_GET['task']) || isset($_GET['cart_virtuemart_product_id'])) { $this->_flushMonitor(); if ($this->_autoflush3rdParty) $this->_monitorThirdPartyPlugins(); } //Check if we have a logged in user and enable cache bypass cookie 'task' => string 'user.login' $user = JFactory::getUser(); if (!$user->guest || (isset($_POST['task']) && preg_match('/login/i', $_POST['task']))) { $_POST[JSession::getFormToken()] = 1; //Force the correct token, since the login box on the page is cached with the 1st visitors' token //Enable the cache bypass for logged users by setting a cache bypass cookie setcookie('jSGCacheBypass',1,time() + 6000,'/'); } if ($user->guest || (isset($_POST['task']) && $_POST['task'] == 'user.logout')) { //Remove the bypass cookie if not a logged user if (isset($_COOKIE['jSGCacheBypass'])) setcookie('jSGCacheBypass',0, time() - 3600,'/'); } // Handle purge button press when get has jSGCache=purge, but only in admin with a logged user if(isset($_GET['jSGCache']) && $_GET['jSGCache'] == 'purge' && JFactory::getApplication()->isAdmin() && !$user->guest ) $this->_purgeCache(true); } /** * Admin panel icon display * * @access public * @param string $context * @return array */ public function onGetIcons( $context ) { return array(array( 'link'=>'?jSGCache=purge', 'image'=>'refresh', 'text'=>JText::_('Purge jSGCache'), 'id'=>'jSGCache' )); } /** * Calls the cache server to purge the cache * * @access public * @param string|bool $message Message to be displayed if purge is successful. If this param is false no output would be done * @return null */ private function _purgeCache( $message = true ) { $purgeRequest = $this->_applicationPath . '(.*)'; // Construct the PURGE request $hostname = str_replace( 'www.', '', $_SERVER['HTTP_HOST'] ); $purge_method = "PURGE"; $cacheServerSocket = fsockopen($hostname, 80, $errno, $errstr, 2); if(!$cacheServerSocket) { JError::raise(E_ERROR,500,JText::_('Connection to cache server failed!')); JError::raise(E_ERROR,500,JText::_($errstr ($errno))); return; } $request = "$purge_method {$purgeRequest} HTTP/1.0\r\nHost: {$_SERVER['SERVER_NAME']}\r\nConnection: Close\r\n\r\n"; if (preg_match('/^www\./',$_SERVER['SERVER_NAME'])) { $domain_no_www = preg_replace('/^www\./', '', $_SERVER['SERVER_NAME']); $request2 = "$purge_method {$purgeRequest} HTTP/1.0\r\nHost: {$domain_no_www}\r\nConnection: Close\r\n\r\n"; } else $request2 = "$purge_method {$purgeRequest} HTTP/1.0\r\nHost: www.{$_SERVER['SERVER_NAME']}\r\nConnection: Close\r\n\r\n"; fwrite($cacheServerSocket, $request); $response = fgets($cacheServerSocket); fclose($cacheServerSocket); $cacheServerSocket = fsockopen($hostname, 80, $errno, $errstr, 2); fwrite($cacheServerSocket, $request2); fclose($cacheServerSocket); if($message !== false) { if(preg_match('/200/',$response)) { if ($message === true) JFactory::getApplication()->enqueueMessage(JText::_('SG Cache Successfully Purged!')); else JFactory::getApplication()->enqueueMessage(JText::_( $message )); } else { JError::raise(E_NOTICE,501, JText::_('SG Cache: Purge was not successful!')); JError::raise(E_NOTICE,501, jText::_('Error: ' . $response)); } } } /** * Check if url is in caching blacklist * * @param string $applicationPath * * @return bool */ private function _isBlacklisted($applicationPath) { $blacklistArray = explode("\n",$this->params->get('blacklist')); $blacklistRegexArray = array(); $indexIsBlacklisted = false; foreach($blacklistArray as $key=>$row) { $row = trim($row); if ($row != '/' && $quoted = preg_quote($row,'/')) $blacklistRegexArray[$key] = $quoted; if ($row == '/') $indexIsBlacklisted = true; } if ($indexIsBlacklisted && $_SERVER['REQUEST_URI'] == $applicationPath) return true; if (empty($blacklistRegexArray)) return false; $blacklistRegex = '/('.implode('|',$blacklistRegexArray) . ')/i'; return preg_match($blacklistRegex, $_SERVER['REQUEST_URI']); } /** * 3rd party plugin monitor * * @access private * @return null */ private function _monitorThirdPartyPlugins() { // Kunena & K2 if ($this->params->get('autoFlush-ThirdParty') == 1 && isset($_POST['option']) && ($_POST['option']=='com_k2' || $_POST['option' ]== 'com_kunena')) { $this->_purgeCache(false); } // VirtueMart if ( (isset($_POST['option']) && $_POST['option'] == 'com_virtuemart') || ( isset($_GET['option']) && $_GET['option'] == 'com_virtuemart' ) || isset($_GET['cart_virtuemart_product_id']) ) { if($this->params->get('autoFlush-ThirdParty') == 1) $this->_purgeCache(false); } } /** * Action monitor * * @access private * @return null */ private function _flushMonitor() { $user = JFactory::getUser(); if ((!JFactory::getApplication()->isAdmin() && !$this->_autoflushClientSide) || $user->guest) return; $autoflush = $this->params->get('autoFlush'); if ($autoflush === null) $autoflush = 1; if (isset($_POST['task']) && $_POST['task'] && !in_array($_POST['task'],self::$_ignoreTasks) && $autoflush == 1) $this->_purgeCache(false); } } Community Support Forums - Sellacious
  Tuesday, 23 February 2021
  11 Replies
  3.6K Visits
  Subscribe
Hi,
On Upgrading to v2.0.0-beta3 , I am getting the following error, when site is being opened.

HY000
SQLSTATE[HY000]: General error: 1 near "(": syntax error

Please help me to fix this error.

Thanks & Regards,
Arshad
3 years ago
·
#5612
Hi,
On commenting the following line in .../libraries/sellacious/objects/Sellacious/Cache/Storage/Sqlite

// $query->clear('select')->select('SUM(1) OVER ()'); // arshad

the error disappeared.
But the page is not displaying properly. I don't think this is the proper fix. Please suggest.
Moreover, I am also getting the following error in other pages.
500
Layout default_price not found.

Please consider this in priority.
Thanks & regards,
Arshad
3 years ago
·
#5613
Hi Arshad,
Do not comment any code, you just need to rebuilt cache and index after that.
But prior to that pls make sure your system fulfils these requirements https://www.sellacious.com/documentation-v2#/learn/basics/system-requirements

For pricing related error make sure there are not layout override in you template.

Thanks
3 years ago
·
#5630
Hi Andresh
Thanks for the support. I tried your suggestion. I get the following notification on rebuilding cache, but the issue remains intake.
Success The cache rebuild process was queued up to run in the background.

Regarding pricing related issue, please tell me how will I do it it template.
Regards,
Arshad
3 years ago
·
#5631
Typo : not "intake", it is unfixed.
3 years ago
·
#5632
Hi,
Can you tell me that what template is on your website and what is the version of sellacious?

also your system should fulfil these requirements https://www.sellacious.com/documentation-v2#/learn/basics/system-requirements
this is must, specially sqlite version an php executable cli.

thanks
3 years ago
·
#5646
Hi,
Template on my website is squick and the version of the sellacious upgraded to the pkg_sellacious_v2.0.0-beta3.zip and
pkg_sellacious_extended_v2.0.0-beta3.zip. The system requirements are fulfilled, except the sqlite3 which shows the correct version on command line after upgrading it, but it still showing the old version in phpinfo query as you will find on clicking the followinf link.
https://new.oplmart.com/phpinfo.php

Please consider this priority.

Thanks & Regards,
Arshad
3 years ago
·
#5647
Hi,
Thats exactly what is causing the issue, pls contact your server provider and upgrade sqlite version 3.25.2 or later version.
It should show in phpinfo too.
Thanks
3 years ago
·
#5651
Hi Indresh,
Thank you so much. We manage our servers ourselves. It is true that phpinfo still shows the older version of sqlite, but if this would be the cause of the error in question, then fresh installation of the version also be having this error. Yes, the fresh installation is working fine as you can check in the following link although the phpinfo even here shows the older version of Sqlite3.

https://nearest.oplmart.com

https://nearest.oplmart.com/phpinfo.php

Thanks & Regards,
Arshad
3 years ago
·
#5652
Hi,
Is this a sellacious_v2.0.0-beta3 ? because this requirement is for sellacious_v2.0.0-beta3. fresh installtion work fine because it is sellacious_v2.0.0-beta1.
if otherwise let me know.
Thanks
3 years ago
·
#5654
Hi Indresh,
Thank you so much. You are right. Fresh installed sellacious is having version sellacious_v2.0.0-beta1 with quickstart bundled. Under the situation, we request you to guide us in sqlite3 version issue. We have already upgraded the sqlite3 to 3.34.1 version and it s appearing in using command, Sqlite3 -- version and in python as follows:-
# pythone
>> import Sqlite3
>> Sqlite3.sqlite_versio
3.34.1

But in phpinfo it is still showing the older version 3.7.17

Thanks & Regards
Arshad Hussain

Hi,
Is this a sellacious_v2.0.0-beta3 ? because this requirement is for sellacious_v2.0.0-beta3. fresh installtion work fine because it is sellacious_v2.0.0-beta1.
if otherwise let me know.
Thanks
3 years ago
·
#5657
Hi,
This is server related issue so Kindly send this issue to your server provider, i think sqlite version is not correctly updated for your instance.
Thanks.
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
  • +1 (408) 821-8283
  • Email hello@sellacious.com