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

use*_*356 2 php mysql magento

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

 $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');
Run Code Online (Sandbox Code Playgroud)

这是引用文件的第67到87行.会喜欢任何帮助.谢谢.

Mar*_*ius 5

看起来该属性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'
Run Code Online (Sandbox Code Playgroud)

查看字段的值is_visible.

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

如果为1,则可能未将该属性设置为在管理表单中显示.获取attribute_id上一个查询返回的内容并执行此操作.让我们说价值是10.

select * from customer_form_attribute where attribute_id = 10;
Run Code Online (Sandbox Code Playgroud)

如果没有带form_code=的记录,adminhtml_customer那么你应该添加它.