OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions ReflectionException When Running Migrations

This topic contains 4 replies, has 3 voices, and was last updated by  pjo 7 years, 8 months ago.

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

  • Creator
    Topic
  • #25119

    archy_bold
    Participant

    I’m getting the following exception when I run migrations. It falls over on the RefreshExtendCacheMigration class.

    [ReflectionException]
    The alias “Oro\Bundle\UserBundle\Model\ExtendUser” for the class “Extend\Entity\EX_OroUserBundle_User” cannot be registered because the class “Oro\Bundle\UserBundle\Model\ExtendUser” is already loaded. This may happen if this class or a derived class is used in EntityConfigDumperExtension or EntityGeneratorExtension.

    I’ve not extended the User entity at all, so I’m not sure why this might happen. I do have my own custom bundle, but I don’t think anything I’ve added would cause this.

    Can someone explain to me how this might happen?

    Simon

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #25120

    Alexander
    Moderator

    Hi, @archy_bold

    Unfortunately for now it’s difficult to explain or help without seeing the code.
    Can you, please, provide yours migration and entity code ?

    Also, please use the platform:update command to apply yours migration(s), and do not forget to clear the cache before running the command. To clear cache use cache:clear command or manually in console from application root folder – rm -rf ./app/cache/*.

    #25121

    archy_bold
    Participant

    Thanks for the reply Alexander. I tried your suggestions and I’m still getting the error.

    I’m probably also not going to be able to provide a code example as the bundle is getting quite large with several entities and 40 migrations.

    I have extended the following entities:

    • CaseEntity – many-to-one relationship to custom entity Order
    • CaseEntity – many-to-one relationship to custom entity Customer
    • Task – many-to-one relationship to custom entity Order

    Is there a particular part of the entities that it would be useful to see?

    #25122

    archy_bold
    Participant

    I just ran the doctrine:schema:validate command and got errors like this:

    Obviously I’ve not defined an inverse to these relationships as the entities are defined in another bundle. Could this indicate the problem? How do I define the inverse of a relationship with an existing entity?

    #25123

    pjo
    Participant

    I have the same kind of misteak but i do not understand. how fix it ?

    I have an error:
    The alias “Oro\Bundle\QueryDesignerBundle\Model\AbstractQueryDesigner” for the class “Extend\Entity\EX_OroSegmentBundle_Segment” cannot be registered because the class “Oro\Bundle\QueryDesignerBundle\Model\AbstractQueryDesigner” is already loaded. This may happen if this class or a derived class is used in EntityConfigDumperExtension or EntityGeneratorExtension.

    Failed migrations: Oro\Bundle\EntityExtendBundle\Migration\RefreshExtendCacheMigration.

    But i never use these classes (AbstractQueryDesigner And EX_OroSegmentBundle_Segment)

    Can you help me please

    Thank you.

    I’m sorry for my english if it is not correct.

Viewing 4 replies - 1 through 4 (of 4 total)

The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.

Back to top