OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce the form's view data is expected to be an instance of Entity

This topic contains 0 replies, has 1 voice, and was last updated by fudu fudu 1 year, 6 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #37622

    i’m trying to override Form/Type in Symfony-Orocommerce, and at first, i got this error:

    Cannot read index “namePrefix” from object of type
    “Oro\CustomerBundle\Entity\CustomerUser” because it doesn’t implement

    And after follow this post,i got another error which i can’t solved :(

    The form’s view data is expected to be an instance of class
    MyCode\Bundle\CustomerBundle\Entity\CustomerUser, but is an instance
    of class Oro\Bundle\CustomerBundle\Entity\CustomerUser. You can avoid
    this error by setting the “data_class” option to null or …

    Here is my code:


    What i’ve done here is i change CustomerUserType to MyCodeCustomerUserType, that’s all.



    Thanks for reading, have a good day :)
    Here is my stackoverflow post (if you interesting)

The forum ‘OroCommerce’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No