应用补丁6788后,Magento Intenso Theme reindex错误

时间:2015-10-29 02:10:52

标签: php magento themes

我安装了带有Intenso Theme的Magento,最近他们推出了一个新的补丁,打破了很多东西。补丁号码6788.

当我尝试重新索引Intenso Theme SEO索引时,它会抛出错误。错误日志如下:

2015-10-29T01:19:26+00:00 DEBUG (7): Exception message: SQLSTATE[42S22]: Column not found: 1054 Unknown column '`main_table`.`frontend_input`' in 'where clause', query was: SELECT `main_table`.*, `additional_table`.* FROM `eav_attribute` AS `main_table`
 INNER JOIN `catalog_eav_attribute` AS `additional_table` ON additional_table.attribute_id = main_table.attribute_id WHERE (`main_table`.`entity_type_id` = '4') AND (```main_table```.```frontend_input``` IN('select', 'multiselect'))
Trace: #0 /var/www/html/magento/includes/src/Varien_Db_Statement_Pdo_Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/magento/includes/src/__default.php(84622): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/html/magento/includes/src/__default.php(73947): Zend_Db_Statement->execute(Array)
#3 /var/www/html/magento/includes/src/__default.php(74990): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#4 /var/www/html/magento/includes/src/__default.php(75850): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#5 /var/www/html/magento/includes/src/__default.php(74204): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#6 /var/www/html/magento/includes/src/__default.php(32544): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#7 /var/www/html/magento/includes/src/__default.php(33170): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#8 /var/www/html/magento/includes/src/__default.php(32376): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 /var/www/html/magento/includes/src/__default.php(31729): Varien_Data_Collection_Db->load()
#10 /var/www/html/magento/includes/src/Itactica_LayeredNavigation_Model_Resource_Indexer_Attribute.php(49): Varien_Data_Collection->getIterator()
#11 /var/www/html/magento/includes/src/Itactica_LayeredNavigation_Model_Resource_Indexer_Attribute.php(33): Itactica_LayeredNavigation_Model_Resource_Indexer_Attribute->reindexSeoUrlKeys()
#12 /var/www/html/magento/includes/src/Mage_Index_Model_Indexer_Abstract.php(143): Itactica_LayeredNavigation_Model_Resource_Indexer_Attribute->reindexAll()
#13 /var/www/html/magento/includes/src/Mage_Index_Model_Process.php(212): Mage_I
#14 /var/www/html/magento/includes/src/Mage_Index_Model_Process.php(260): Mage_I
#15 /var/www/html/magento/app/code/core/Mage/Index/controllers/Adminhtml/Process
#16 /var/www/html/magento/includes/src/__default.php(419): Mage_Index_Adminhtml_
#17 /var/www/html/magento/includes/src/__default.php(18922): Mage_Core_Controlle
#18 /var/www/html/magento/includes/src/__default.php(18452): Mage_Core_Controlle
#19 /var/www/html/magento/includes/src/__default.php(21292): Mage_Core_Controlle
#20 /var/www/html/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /var/www/html/magento/index.php(87): Mage::run('', 'store')
#22 {main}

它似乎没有正确构建查询。但我不知道构建查询的代码在哪里,有人可以指点我吗?

1 个答案:

答案 0 :(得分:1)

现在可以更新Intenso for 1.9.2.2和SUPEE-6788补丁。

可以通过修改以下文件来解决索引器问题: app/code/local/Itactica/LayeredNavigation/Model/Resource/Indexer/Attribute.php

修改此功能:

protected function _getAttributes($attributeId = null)
{
    $collection = Mage::getSingleton('eav/config')
        ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
        ->getAttributeCollection()
        ->addFieldToFilter('`main_table`.`frontend_input`', array('in' => array('select', 'multiselect')));
    if (!empty($attributeId)) {
        $collection->addFieldToFilter('`main_table`.`attribute_id`', $attributeId);
    }
    return $collection;
}

对此:

protected function _getAttributes($attributeId = null)
{
    $collection = Mage::getSingleton('eav/config')
        ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
        ->getAttributeCollection()
        ->addFieldToFilter('frontend_input', array('in' => array('select', 'multiselect')));
    if (!empty($attributeId)) {
        $collection->addFieldToFilter('attribute_id', $attributeId);
    }
    return $collection;
}