I added some custom attributes and i set - show_address_fields -> true in the layout for the reference block customer_form_register but i get this error when trying to create a customer. The address is not added but the customer is added so what's the problem. Any help ,please ?

1 Answer 1


In your construct function add the Registry class like -

\Magento\Framework\Registry $registry,

And then in your construct function add like -

$registry->register('isSecureArea', true);
  • Which construct i need to add this i am getting same error on create customer in magento2 ? Jan 4, 2019 at 12:27
  • I have the same issue, can you add some more reference to this solution? Would be supergreat! Jul 28, 2020 at 9:45
  • I have the same problem, may I ask which constructor ? Registry is now deprecated
    – wezzy
    Aug 18, 2020 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.