编辑客户帐户时的Magento致命错误


Magento Fatal Error when editing customer accounts

我有Magento 1.7.0.2,当我尝试在管理面板中编辑客户帐户时,出现此错误:致命错误:在第 77 行的/home/techspec/public_html/magento/include/src/Mage_Adminhtml_Block_Customer_Edit_Tab_Account.php 中的非对象上调用成员函数 setRenderer()

 $attributes = $customerForm->getAttributes();
    foreach ($attributes as $attribute) {
        /* @var $attribute Mage_Eav_Model_Entity_Attribute */
        $attribute->setFrontendLabel(Mage::helper('customer')->__($attribute->getFrontend()->getLabel()));
        $attribute->unsIsVisible();
    }
    $disableAutoGroupChangeAttributeName = 'disable_auto_group_change';
    $this->_setFieldset($attributes, $fieldset, array($disableAutoGroupChangeAttributeName));
    $form->getElement('group_id')->setRenderer($this->getLayout()
        ->createBlock('adminhtml/customer_edit_renderer_attribute_group')
        ->setDisableAutoGroupChangeAttribute($customerForm->getAttribute($disableAutoGroupChangeAttributeName))
        ->setDisableAutoGroupChangeAttributeValue($customer->getData($disableAutoGroupChangeAttributeName)));
    if ($customer->getId()) {
        $form->getElement('website_id')->setDisabled('disabled');
        $form->getElement('created_in')->setDisabled('disabled');
    } else {
        $fieldset->removeField('created_in');
        $form->getElement('website_id')->addClass('validate-website-has-store');

这是引用文件的第 67 行到第 87 行。希望得到任何帮助。谢谢。

属性

group_id似乎不在可编辑属性列表中。确保该属性可见。使用此选择进行检查。

SELECT * FROM `eav_attribute` e 
LEFT JOIN `customer_eav_attribute` ce ON e.attribute_id = ce.attribute_id 
WHERE e.attribute_code = 'group_id'

请参阅字段 is_visible 的值。

如果您没有从上面的查询中获得任何结果,那么您就有麻烦了。

如果为 1,则可能该属性未设置为显示在管理表单中。获取上一个查询返回的attribute_id并执行此操作。假设值为 10

select * from customer_form_attribute where attribute_id = 10;

如果没有 form_code = adminhtml_customer 的记录,则应添加它。