OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Installation/Technical Issues or Problems No mapping found for field 'picture' on class '…Entity\Contact'

This topic contains 6 replies, has 4 voices, and was last updated by  Artem Liubeznyi 7 years, 9 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
  • #27015

    abober
    Participant

    After migration from 1.9.0-RC1 to 1.9.0 I have an error.

    When I try view contacts, I see error message:

    An exception has been thrown during the rendering of a template (“No mapping found for field ‘picture’ on class ‘OroCRM\Bundle\ContactBundle\Entity\Contact’.”) in vendor/oro/platform/src/Oro/Bundle/UIBundle/Resources/views/actions/index.html.twig at line 44.

    I removed all files from app/cache directory, and did oro:migration:load –force command

    I was looking for and I don’t have any mapping class for table oro_attachment_file.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #27016

    Ivan Klymenko
    Spectator

    Hi abober,
    how did you upgrade your OroCRM project to the latest release?

    Did you run next command after composer install:

    Because executing oro:migration:load command is not a valid way to upgrade.

    #27017

    abober
    Participant

    Hi, thx for answer, I can’t remember, but I think that I started from this command and something went wrong, so I was trying to debug step by step.

    I think it doesn’t matter, because when you look here:
    https://github.com/orocrm/crm/blob/master/src/OroCRM/Bundle/ContactBundle/Entity/Contact.php

    indeed there is no mapping for picture field.

    I’ve found Oro\Bundle\AttachmentBundle\Entity\File which maps oro_attachment_file table, and I’ve added reference in Contact class.

    Now all works fine.

    #27018

    Ivan Klymenko
    Spectator

    Hi Anna,
    picture field is extended field, so it should not be present in the mapping of the original entity class. It should be added by migration and then automatically mapped in the EX_OroCRMContactBundle_Contact.php.

    If you will add property for the extended field directly to the original entity class, it could lead to an issues if this extended field will be deleted manually from the UI or from a migration.

    From my opinion the appropriate migration was not executed, or appropriate proxy class was not generated properly. Could you please check the oro_migration table and tell what version is set for OroCRMContactBundle?

    #27019

    abober
    Participant

    My oro_migrations record for ContactBundle:

    id | bundle | version | loaded_at
    —-+—————————–+———+———————
    37 | OroCRMContactBundle | v1_13 | 2015-11-03 15:51:37

    #27020

    dimitri.seguin17
    Participant

    Hello, I have the same problem, this was resolved ?

    #27021

    Artem Liubeznyi
    Spectator

    Hi Dimitri,

    As I can see from the discussion, Anna had this sorted out. Please see Ivan’s response above.

    Thank you.

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

The forum ‘OroCRM – Installation/Technical Issues or Problems’ is closed to new topics and replies.

Back to top