Magento – After update i got strange error

ce-1.9.2.0errormagento-1.9MySQLupgrade

I just updated my Magento to 1.9.2 and there is the error log file:

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 '.`value)` = '0') AND (`start_time` = '2015-10-' at line 2, query was: SELECT `main_table`.* FROM `bannerslider_banner` AS `main_table` LEFT JOIN `bannerslider_value` AS `status` ON main_table.banner_id = status.banner_id AND status.store_id = 1 AND status.attribute_code = 'status' WHERE (`bannerslider_id` = '2') AND (`IF(status`.`value IS NULL, main_table`.`status, status`.`value)` = '0') AND (`start_time` = '2015-10-28') ORDER BY order_banner ASC

a:5:{i:0;s:643:"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 '.`value)` = '0') AND (`start_time` = '2015-10-' at line 2, query was: SELECT `main_table`.* FROM `bannerslider_banner` AS `main_table`
 LEFT JOIN `bannerslider_value` AS `status` ON main_table.banner_id = status.banner_id AND status.store_id = 1 AND status.attribute_code = 'status' WHERE (`bannerslider_id` = '2') AND (`IF(status`.`value IS NULL, main_table`.`status, status`.`value)` = '0') AND (`start_time` = '2015-10-28') ORDER BY order_banner ASC";i:1;s:4886:"#0 lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#4 lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#5 lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#6 lib/Varien/Data/Collection/Db.php(740): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#7 app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#8 lib/Varien/Data/Collection/Db.php(572): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 lib/Varien/Data/Collection.php(741): Varien_Data_Collection_Db->load()
#10 app/code/community/Magestore/Bannerslider/Block/Default.php(44): Varien_Data_Collection->getIterator()
#11 app/design/frontend/base/default/template/bannerslider/bannerslider.phtml(28): Magestore_Bannerslider_Block_Default->getBlockData()
#12 app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/html/d...')
#13 app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')
#14 app/code/community/Magestore/Bannerslider/Block/Bannerslider.php(47): Mage_Core_Block_Template->renderView()
#15 app/code/core/Mage/Core/Block/Abstract.php(919): Magestore_Bannerslider_Block_Bannerslider->_toHtml()
#16 app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#17 app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#18 app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#19 app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#20 app/design/frontend/base/default/template/page/1column.phtml(48): Mage_Core_Block_Abstract->getChildHtml('content')
#21 app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/html/d...')
#22 app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')
#23 app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#24 app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#25 app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#26 app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#27 app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#28 app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#29 app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#30 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#31 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#32 app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#33 app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#34 app/Mage.php(684): Mage_Core_Model_App->run(Array)
#35 index.php(83): Mage::run('', 'store')
#36 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

I can not understand where i can find the file causing the problem.

Can you help me out find the file which is causing the problem?

Best Answer

A (temporary - until the developers release a new version) fix that worked for me:

In file

app/code/community/Magestore/Bannerslider/Model/Mysql4/Banner/Collection.php

at line 60 comment the following:

return parent::addFieldToFilter("IF($field.value IS NULL, main_table.$field, $field.value)", $condition);

and replace it with

 $this->getSelect()->where("IF($field.value IS NULL, main_table.$field, $field.value) = 0");

As per answer found here: http://answers.magentocommerce.com/answers/4643-en_us/product/3912/magestore-banner-slider-questions-answers/questions.htm?sort=recentq#BVQASAnswerText598988

Related Topic