Magento在升级后显示服务器中的错误

时间:2012-07-31 05:18:57

标签: magento upgrade magento-1.4 magento-1.7

我升级了我的magento网站。升级完成没有错误。

但是当我在浏览器中加载网站时,我得到了重复的输入错误,所以我清除了数据库并再次在浏览器中取了网址。但是现在我收到了这个错误:

Mage_Eav_Exception Object
(
    [_messages:protected] => Array
        (
        )

    [message:protected] => Maximum length of attribute code must be less then 30 symbols
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /var/www/magento_upgrade/app/Mage.php
    [line:protected] => 579
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /var/www/magento_upgrade/app/code/core/Mage/Eav/Model/Entity/Attribute.php
                    [line] => 158
                    [function] => exception
                    [class] => Mage
                    [type] => ::
                    [args] => Array
                        (
                            [0] => Mage_Eav
                            [1] => Maximum length of attribute code must be less then 30 symbols
                        )

                )

            [1] => Array
                (
                    [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Abstract.php
                    [line] => 316
                    [function] => _beforeSave
                    [class] => Mage_Eav_Model_Entity_Attribute
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [2] => Array
                (
                    [file] => /var/www/magento_upgrade/app/code/community/Biebersdorf/CustomerOrderComment/sql/customerordercomment_setup/mysql4-install-0.0.3.php
                    [line] => 49
                    [function] => save
                    [class] => Mage_Core_Model_Abstract
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [3] => Array
                (
                    [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 624
                    [args] => Array
                        (
                            [0] => /var/www/magento_upgrade/app/code/community/Biebersdorf/CustomerOrderComment/sql/customerordercomment_setup/mysql4-install-0.0.3.php
                        )

                    [function] => include
                )

            [4] => Array
                (
                    [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 421
                    [function] => _modifyResourceDb
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => install
                            [1] => 
                            [2] => 0.1.3
                        )

                )

            [5] => Array
                (
                    [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 327
                    [function] => _installResourceDb
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 0.1.3
                        )

                )

            [6] => Array
                (
                    [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 235
                    [function] => applyUpdates
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [7] => Array
                (
                    [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/App.php
                    [line] => 417
                    [function] => applyAllUpdates
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ::
                    [args] => Array
                        (
                        )

                )

            [8] => Array
                (
                    [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/App.php
                    [line] => 343
                    [function] => _initModules
                    [class] => Mage_Core_Model_App
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [9] => Array
                (
                    [file] => /var/www/magento_upgrade/app/Mage.php
                    [line] => 683
                    [function] => run
                    [class] => Mage_Core_Model_App
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [scope_code] => 
                                    [scope_type] => store
                                    [options] => Array
                                        (
                                        )

                                )

                        )

                )

            [10] => Array
                (
                    [file] => /var/www/magento_upgrade/index.php
                    [line] => 87
                    [function] => run
                    [class] => Mage
                    [type] => ::
                    [args] => Array
                        (
                            [0] => 
                            [1] => store
                        )

                )

        )

    [previous:Exception:private] => 
)

我该如何解决这个问题? 或者我在这做什么?

2 个答案:

答案 0 :(得分:2)

在你的Magento安装的实际版本和你想要升级到的版本之间的某个地方,Magento限制了EAV属性的sku字符。
您遇到的错误是因为您的某个属性在其SKU中有超过30个字符。

您可以做的一件事是覆盖Mage_Eav_Model_Entity_Attribute :: ATTRIBUTE_CODE_MAX_LENGTH并使其足够大,以便继续升级。

HTH

答案 1 :(得分:0)

为清楚起见,您要编辑的文件的完整路径是......

  

your-project / app / code / core / Mage / Eav / Model / Entity / Attribute.php CONST   ATTRIBUTE_CODE_MAX_LENGTH = 30;

     

把CONST ATTRIBUTE_CODE_MAX_LENGTH = 30;至60

被盗:Bijal Bhavsar