在后端加载目录设置时出现致命错误
在全新的 1.5.0.1 Magento 安装中,当从设置 -> 设置菜单中选择目录时,出现以下错误:
致命错误:未定义类常量“RANGE_CALCULATION_AUTO” /my-install-dir/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php 第 33 行
检查 Step.php
它看起来没有损坏,并包含以下内容:
class Mage_Adminhtml_Model_System_Config_Source_Price_Step
{
public function toOptionArray()
{
return array(
array(
'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_AUTO,
'label' => Mage::helper('adminhtml')->__('Automatic')
),
array(
'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_MANUAL,
'label' => Mage::helper('adminhtml')->__('Manual')
),
);
}
}`
有人知道这个错误或如何修复它吗?
On a fresh 1.5.0.1 Magento install when choosing Catalog from the settings->settings menu I get the following error:
Fatal error: Undefined class constant 'RANGE_CALCULATION_AUTO' in
/my-install-dir/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php on line 33
Checked Step.php
and it does not look damaged and contains the following:
class Mage_Adminhtml_Model_System_Config_Source_Price_Step
{
public function toOptionArray()
{
return array(
array(
'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_AUTO,
'label' => Mage::helper('adminhtml')->__('Automatic')
),
array(
'value' => Mage_Catalog_Model_Layer_Filter_Price::RANGE_CALCULATION_MANUAL,
'label' => Mage::helper('adminhtml')->__('Manual')
),
);
}
}`
Anyone know this error or how to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PHP 抱怨它找不到在类
Mage_Catalog_Model_Layer_Filter_Price
上定义的RANGE_CALCULATION_AUTO
常量根据您上面的评论,听起来您已经检查了该文件
以确保定义了正确的常量。
基于此,我的猜测是为此类加载了一个不同 Price.php。如果
有人在
社区
或本地
或本地
中放置有人使用了 Magento 正常猴子业务之外的包含路径
检查文件
如果这不起作用,请添加一些临时文件调试代码
使用反射来找出 PHP 正在从哪个文件加载类。
这将转储出一个文件路径,该文件路径指向 PHP 加载类的确切位置,这应该可以让您到达需要去的地方。
PHP is complaining that it can't find the constant on
RANGE_CALCULATION_AUTO
defined on the classMage_Catalog_Model_Layer_Filter_Price
Based on your comments above, it sounds like you already checked the file at
to ensure is had the correct constant defined.
Based on that, my guess would be there's a different Price.php being loaded for this class. This can happen if
Someone's placed a different version in
community
orlocal
Someone's monkied with the include path beyond Magento's normal monkey business
Check for files at
If that doesn't work, add some temporary debugging code to
that uses reflection to figure out what file PHP is loading the class from
This will dump out a file path that points to the exact place PHP is loading the class from, which should get you where you need to go.