OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums OroCommerce Invalid PathExpression. Must be a StateFieldPathExpression

This topic contains 1 reply, has 2 voices, and was last updated by Andrey Yatsenko Andrey Yatsenko 5 months, 3 weeks ago.

  • Creator
    Topic
  • #37651
    fudu
    fudu
    Participant

    Hello, I’m trying to query using entityManager and connect to entity OrderAddress, and i got this error:

    [Semantical Error] line 0, col 27 near ‘country ‘: Error: Invalid
    PathExpression. Must be a StateFieldPathExpression.

    Here is how i did:

    I’ve notice that this entity doesn’t define country, its extends from an abstract called AbstractAddress.

    I’ve also try to extends the OrderAddress entity and define the country, but it say the country already exists. So i can’t do it.
    Here is how i extends:

    Please give advice in this situation. Thanks, have a nice week.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #37659
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Please check the base theory of how entity extends functionality works at ORO. You should never extend entities directly with php extends, instead, please use migrations.
    https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/EntityExtendBundle/README.md

    The country field is already there. the issue probably in the query itself, not in the database structure.

    Firts issue I see, parameters should not be passed to query directly, please use placeholders and setParameter method instead, like:

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.

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

Yes No