Day: February 18, 2010

  • Cleanup after upgrade Magento to 1.4

    升级总有这样那样的问题,我不想节外生枝,也就不想在项目中途升级。我把一个正在开发中的 Magento 商店开始开发时版本是 1.3.2.4,但今天一不小心,敲入了

    ./pear install magento-core/Mage_All_Latest

    就把 Magento 升级到了 1.4。

    (要怪 Magento 升级太方便了?其实,今天的不小心是有原因的:我发现 Magento Connect 启动不了。尝试进入 Magento Connect 时通常要求再次输入管理员密码,但今天这个页面只有 Magento Connect logo,看上去页面意外中止。而我急着想试用一下某个 community extension,就用了 pear 命令。在敲键盘的过程中,脑筋没多想,竟然敲入 ./pear install magento-core/Mage_All_Latest,就坏事了。)

    升级以后发现后台 System/Configuration 保存时经常出错,错误提示:

    Error while saving this configuration: Invalid mode for clean() method

    CMS/Pages 也无法保存页面,错误提示:

    Error while saving Page. Please try again later

    Catalog/Products 也无法保存修改…

    我猜想所有这些错误都来自一个地方。错误多了反而好办——肯定他人也会碰到。果然,google 一下不怎么费力就找到答案:删除 app/code/core/Zend/Cache 目录就可以了。

    这证明了我的一个保证升级后不出错的土办法:先保持原有文件不动进行升级,然后把新老版本混合在一起的文件夹删除,然后再上传一份干净的新版本(被新版本抛弃的老文件就被删除了)。当然也可以用版本比较工具来找不同,但土办法更省事。

  • Dull_Addressfields Magento extension

    I could not edit customer order delivery address at backend using Magento 1.3.2.4. Checkbox “Same As Billing Address” is always ticked. When I untick it, it automatically tick itself. I was able to edit it some while ago. What happened since then?

    Half an hour later I found the problem was caused by installation of Dull_Addressfields 1.0. This extension was installed because I wanted to “Same As Billing Address” as a default choice at checkout. But even if I set “Default delivery address to billing address” to “No” without uninstall Dull_Addressfields. I upgrade Magento to 1.4. Problem remains.

    So I have to uninstall Dull_Addressfields. Actually, with the skills I acquired nowadays, I can make “Same As Billing Address” as a default choice without 3rd party extension. But my boss don’t want to make “Same As Billing Address” as a default choice. Situation changed since I installed Dull_Addressfields.

    Btw, Dull_Addressfields rewrites two classes: Mage_Customer_Model_Address and Mage_Sales_Model_Quote_Address. As Magento can’t safely handle two extensions rewrite a same class, I don’t want Mage_Customer_Model_Address and Mage_Sales_Model_Quote_Address to be rewritten by Dull_Addressfields (just to achieve a simple goal?). I’d like these important classes be untouched for future rewriting for important functionalities.