Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend customer form doesn't render if custom customer attribute is added #1916

Closed
wojtekn opened this issue Sep 21, 2015 · 4 comments
Closed

Comments

@wojtekn
Copy link
Contributor

wojtekn commented Sep 21, 2015

I installed custom customer attribute in a way shown on Magento 2 training which is similar to one from @Vinai comment:

#1238 (comment)

        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $customerSetup->addAttribute(
            \Magento\Customer\Model\Customer::ENTITY,
            'nickname',
            [
                'label'            => 'Nickname',
                'required'         => 0,
                'system'           => 0,
                'position'         => 100
            ]
        );

        $customerSetup->getEavConfig()->getAttribute('customer', 'nickname')
            ->setData('used_in_forms', ['adminhtml_customer'])
            ->save();

Attribute is properly installed as I see it in eav_attribute, customer_eav_attribute and customer_form_attribute tables. However, backend customer form doesn't work for me anymore and it is empty. It looks that the whole main-col container is missing in rendered html. Store is in developer mode, logs are empty. I cleared var/cache/*, var/generation/* and pub/static/*.

When I change my custom attribute property is_visible to 0 manually in database, form works again.

Any idea what could be wrong?

@voleye
Copy link

voleye commented Sep 23, 2015

Hi @wojtekn

I tried to do the same but it works for me.
Looks on an error during rendering. (see the file lib/internal/Magento/Framework/View/TemplateEngine/Php.php, method "render")
If you are able debug this exception probably you will see the error. But any way this error should be present in your logs.

Could you remove "./var/log" or "./var/report" folders then trigger error by opening broken customer page and then check these folders again?

@wojtekn
Copy link
Contributor Author

wojtekn commented Sep 24, 2015

Thanks for checking this @voleye. I tried it again on fresh installation on master and develop branches and it looks it works well on develop and it doesn't work on master. I'm not sure if it should be considered as issue then.

@voleye
Copy link

voleye commented Sep 28, 2015

@wojtekn no problem, please feel free to ask if you have any additional questions

I closed this issue since it was fixed in develop branch

@voleye voleye closed this as completed Sep 28, 2015
@phanikumar111
Copy link

How to add the custom field in registration form and save from frontend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants