I'm trying to resolve this issue that only occurs when I click any link in my menu. At first after clicking, I get an error page entitled There has been an error processing your request, but refreshes the same page after that renders the page it should.
After inspecting the error number in /magentoroot/var/report
I see the following stack trace which doesn't appear to be the fault of any of the third-party extensions:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 1, query was: SELECT `catalog_category_entity`.* FROM `catalog_category_entity` WHERE (entity_id =)
Trace:
#0 /var/www/magento/includes/src/Varien_Db_Statement_Pdo_Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/magento/includes/src/__default.php(64952): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/magento/includes/src/__default.php(54273): Zend_Db_Statement->execute(Array)
#3 /var/www/magento/includes/src/__default.php(55316): Zend_Db_Adapter_Abstract->query('SELECT `catalog...', Array)
#4 /var/www/magento/includes/src/__default.php(56176): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `catalog...', Array)
#5 /var/www/magento/includes/src/__default.php(54549): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /var/www/magento/includes/src/__default.php(42637): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select))
#7 /var/www/magento/includes/src/__catalog.php(4819): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
#8 /var/www/magento/includes/src/__default.php(5899): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
#9 /var/www/magento/includes/src/Mage_Catalog_Block_Product_List.php(80): Mage_Core_Model_Abstract->load(Object(Mage_Catalog_Model_Category))
#10 /var/www/magento/includes/src/Mage_Catalog_Block_Product_List.php(142): Mage_Catalog_Block_Product_List->_getProductCollection()
#11 /var/www/magento/includes/src/__default.php(2612): Mage_Catalog_Block_Product_List->_beforeToHtml()
#12 /var/www/magento/includes/src/__default.php(2331): Mage_Core_Block_Abstract->toHtml()
#13 /var/www/magento/includes/src/__default.php(2275): Mage_Core_Block_Abstract->_getChildHtml('product_list', true)
#14 /var/www/magento/includes/src/Mage_Catalog_Block_Category_View.php(90): Mage_Core_Block_Abstract->getChildHtml('product_list')
#15 /var/www/magento/app/design/frontend/polar/default/template/catalog/category/view.phtml(63): Mage_Catalog_Block_Category_View->getProductListHtml()
#16 /var/www/magento/includes/src/__default.php(3408): include('/var/www/magent...')
#17 /var/www/magento/includes/src/__default.php(3439): Mage_Core_Block_Template->fetchView('frontend/polar/...')
#18 /var/www/magento/includes/src/__default.php(3453): Mage_Core_Block_Template->renderView()
#19 /var/www/magento/includes/src/__default.php(2613): Mage_Core_Block_Template->_toHtml()
#20 /var/www/magento/includes/src/__default.php(13677): Mage_Core_Block_Abstract->toHtml()
#21 /var/www/magento/includes/src/__default.php(2613): Mage_Core_Block_Text_List->_toHtml()
#22 /var/www/magento/includes/src/__default.php(2331): Mage_Core_Block_Abstract->toHtml()
#23 /var/www/magento/includes/src/__default.php(2275): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#24 /var/www/magento/app/design/frontend/polar/default/template/page/2columns-left.phtml(53): Mage_Core_Block_Abstract->getChildHtml('content')
#25 /var/www/magento/includes/src/__default.php(3408): include('/var/www/magent...')
#26 /var/www/magento/includes/src/__default.php(3439): Mage_Core_Block_Template->fetchView('frontend/polar/...')
#27 /var/www/magento/includes/src/__default.php(3453): Mage_Core_Block_Template->renderView()
#28 /var/www/magento/includes/src/__default.php(2613): Mage_Core_Block_Template->_toHtml()
#29 /var/www/magento/includes/src/__default.php(28278): Mage_Core_Block_Abstract->toHtml()
#30 /var/www/magento/includes/src/__default.php(14070): Mage_Core_Model_Layout->getOutput()
#31 /var/www/magento/app/code/core/Mage/Catalog/controllers/CategoryController.php(161): Mage_Core_Controller_Varien_Action->renderLayout()
#32 /var/www/magento/includes/src/__default.php(14098): Mage_Catalog_CategoryController->viewAction()
#33 /var/www/magento/includes/src/__default.php(18482): Mage_Core_Controller_Varien_Action->dispatch('view')
#34 /var/www/magento/includes/src/__default.php(18016): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#35 /var/www/magento/includes/src/__default.php(20808): Mage_Core_Controller_Varien_Front->dispatch()
#36 /var/www/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#37 /var/www/magento/index.php(87): Mage::run('', 'store')
#38 {main}
Any ideas on where I should start, and has anybody experienced this particular type of error?
UPDATE
After disabling compilation as per Tyler's suggestion below, I am still getting an error, but attached is the stack trace:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 1, query was: SELECT `catalog_category_entity`.* FROM `catalog_category_entity` WHERE (entity_id =)
Trace:
#0 /var/www/magento/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/magento/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/magento/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/magento/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `catalog...', Array)
#4 /var/www/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `catalog...', Array)
#5 /var/www/magento/lib/Zend/Db/Adapter/Abstract.php(756): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php(943): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select))
#7 /var/www/magento/app/code/core/Mage/Catalog/Model/Resource/Abstract.php(698): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
#8 /var/www/magento/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
#9 /var/www/magento/app/code/core/Mage/Catalog/Block/Product/List.php(80): Mage_Core_Model_Abstract->load(Object(Mage_Catalog_Model_Category))
#10 /var/www/magento/app/code/core/Mage/Catalog/Block/Product/List.php(142): Mage_Catalog_Block_Product_List->_getProductCollection()
#11 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Catalog_Block_Product_List->_beforeToHtml()
#12 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#13 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('product_list', true)
#14 /var/www/magento/app/code/core/Mage/Catalog/Block/Category/View.php(90): Mage_Core_Block_Abstract->getChildHtml('product_list')
#15 /var/www/magento/app/design/frontend/polar/default/template/catalog/category/view.phtml(63): Mage_Catalog_Block_Category_View->getProductListHtml()
#16 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/magent...')
#17 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/polar/...')
#18 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#19 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#20 /var/www/magento/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#21 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#22 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#23 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#24 /var/www/magento/app/design/frontend/polar/default/template/page/2columns-left.phtml(53): Mage_Core_Block_Abstract->getChildHtml('content')
#25 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/magent...')
#26 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/polar/...')
#27 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#28 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#29 /var/www/magento/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#30 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#31 /var/www/magento/app/code/core/Mage/Catalog/controllers/CategoryController.php(161): Mage_Core_Controller_Varien_Action->renderLayout()
#32 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_CategoryController->viewAction()
#33 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#34 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#35 /var/www/magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#36 /var/www/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#37 /var/www/magento/index.php(87): Mage::run('', 'store')
#38 {main}
Reading this trace, I cannot figure out where the problem is originating, but I do know that the problem lies in a call to catalog_category_entity
. I'm certain that it can't be any core files, and the 5 or 6 custom extensions installed were all working a week or two back.
Code from app/design/frontend/polar/default/template/catalog/category/view.phtml:
<?php
$_helper = $this->helper('catalog/output');
$_category = $this->getCurrentCategory();
$_imgHtml = '';
if ($_imgUrl = $_category->getImageUrl()) {
$_imgHtml = '<p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->escapeHtml($_category->getName()).'" title="'.$this->escapeHtml($_category->getName()).'" /></p>';
$_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
}
?>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php if($_imgUrl): ?>
<?php echo $_imgHtml ?>
<?php endif; ?>
<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
<div class="category-description std">
<?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
<?php endif; ?>
<?php if($this->isContentMode()): ?>
<?php echo $this->getCmsBlockHtml() ?>
<?php elseif($this->isMixedMode()): ?>
<?php echo $this->getCmsBlockHtml() ?>
<?php echo $this->getProductListHtml() ?>
<?php else: ?>
<?php echo $this->getProductListHtml() ?> // LINE 63
<?php endif; ?>