OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Installation/Technical Issues or Problems Error after updating OroCRM – Avatar Issue

This topic contains 16 replies, has 4 voices, and was last updated by  oro_newbie 7 years, 7 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
  • #27281

    oro_newbie
    Participant

    Hi,

    I’m getting the following error when opening the “My User” page. I wasn’t getting this previously but I recently updated the OroCRM so that might be causing the issue:

    “Neither the property “avatar” nor one of the methods “getAvatar()”, “avatar()”, “isAvatar()”, “hasAvatar()”, “__get()” exist and have public access in class “Oro\Bundle\UserBundle\Entity\User”.”) in “OroUserBundle:User:view.html.twig” at line 41.”

    Full error:

    P.S.: I’m not overriding anything from the UserBundle.

    Thank you.

Viewing 15 replies - 1 through 15 (of 16 total)
  • Author
    Replies
  • #27282

    oro_newbie
    Participant

    Bump.

    Hoping someone from the Oro Core team can help since I have no idea where the change needs to be done because I haven’t overridden this bundle in my application.

    #27283

    Mike Kudelya
    Participant

    Hi,

    Please tell me which version installed now and which was before.
    Which command have you updated your system ?

    Probably app/cache/[env type]/oro_entities/Extend/Entity/EX_OroUserBundle_User.php doesn’t contain $avatar property. Try to run “app/console oro:platform:update –env dev –force –timeout 9000” and check again, will appear this property or not.

    #27284

    oro_newbie
    Participant

    Hi Mike,

    I’m not sure which version was installed before but after updating it’s the below:

    system information

    I tried the command that you said and I probably used the same command before except it might have been for the prod environment.

    After running the command I checked the app/cache/dev/…/EX_OroUserBundle_User.php and it has below:

    In my localhost this file has the property and other properties that you have mentioned but the production server doesn’t seem to have them. What do you think could be the cause of this issue? I’m not sure why it doesn’t seem to pick these properties although I see these fields on the User Entity Management page.

    PS: Below is the system information of my localhost:

    system information - localhost

    #27285

    Mike Kudelya
    Participant

    Hi,

    It is very strange. Can you show me the result of two sql’s ?

    Did you get any errors when system was updating ? Probably system didn’t add this fields to oro_entity_config* tables and doesn’t know about them.

    #27286

    Mike Kudelya
    Participant

    If you install from scratch new instance of orocrm 1.9.4 on production server, will you get the same errors ?

    #27287

    oro_newbie
    Participant

    Hi Mike here’s the 2 query results:

    Also no error when I was updating the platform, it went smooth.

    Regarding the new install, I really can’t afford to do that right now since the application’s already in production mode and even if I make a new instance I would have to apply all the migrations again (it’s a little unorganized). I tried to directly edit the cache files (which I know is not really a solution) with the needed properties but it doesn’t seem to pick the changes.

    #27288

    oro_newbie
    Participant

    Bump.

    Do you think we can use any workaround for this issue? Since the system is completely blocking users from changing their password and me from creating any new users. I’m thinking of trying to override the UserBundle and add the needed properties with the getters and setters myself. Do you think that would help?

    #27289

    wwsh
    Participant

    Hi.
    It seems like you have the missing fields in the entity configuration.
    What environment did you run this command against? If the problem is in the prod you need to update the app/cache/[env type] path.
    Please clear the cache folder and try regenerating it with the cache:warmup command and afterwards use the command Mike provided.
    Good luck!

    #27290

    oro_newbie
    Participant

    Hi wwsh,

    I ran the command against the prod environment. I tried like you said, removing the cache folder, running cache:warmup with prod environment and then Mike’s command as “app/console oro:platform:update –env=prod –-force –-timeout=9000” but still no luck. On comparing with my local there’s one difference I found between the User fields:

    On my localhost, the avatar data type is ‘Image’:

    But on my production server, the avatar data type is ‘System Relation’:

    Could this be causing the extended fields from not loading correctly?

    Any help to even debug this issue is appreciated please, since I’m stuck with not being able to create any new users.

    Thank you.

    #27291

    oro_newbie
    Participant

    Okay, so the ONLY workaround I got working for this issue is to directly edit the vendor file (vendor/oro/platform/src/Oro/Bundle/UserBundle/Entity/User.php) and add the needed properties with the getters and setters.

    Obviously this is a bad practice and isn’t really a solution. Updating the platform would remove all your changes so use it only for temporary purpose.

    #27292

    Mike Kudelya
    Participant

    Hi,

    Please show me the result of:

    #27293

    oro_newbie
    Participant

    Hello Mike,

    Here’s the result:

    #27294

    Artem Liubeznyi
    Spectator

    Have you considered trying the latest version of the application? At least the 1.9 branch, if upgrading to 1.10 is too complicated.

    #27295

    oro_newbie
    Participant

    Hi Artem,

    The installed version currently is 1.9.4, below is my system information.

    Is this the same that you are speaking about?

    #27296

    Mike Kudelya
    Participant

    Hi,

    I have one question: why are you updating system to exactly 1.9.4 version? 1.9.4 version on half way to 1.9 release. Instead switching on 1.9.4, try switch to 1.9 branch or latest 1.9.7 tag. Also you can switch to 1.10 branch. Usually i install and update my system on ‘dev’ mode, i.e ‘app/console oro:platform:update –-env dev –force –-timeout 9000’.

    If this didn’t help, i see one way to repair your config of User entity.

    • Do backup of our production database and code
    • Delete any modifications in vendor folder
    • Update our production server to certain version, install fresh, for example locally the same working version of crm
    • As you can see table oro_entity_config contains one record with ‘Oro\Bundle\UserBundle\Entity\User’ entity, also there is the field ‘data’, which contains array with entity config, encrypted to base64. Your task is replace from locally server to production server full text of ‘data’ field
    • Do the same with oro_entity_config_field table, find all extended fields of User entity (title, phone, avatar…)
    • Delete cache/dev, cache/prod directories
    • Run ‘app/console oro:platform:update –-env dev –force –-timeout 9000’

    I hope it helps!

Viewing 15 replies - 1 through 15 (of 16 total)

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

Back to top