User profile is not loading for users, but visible to admins due to a js error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crmtesting
    Member
    • Oct 2024
    • 44

    #1

    User profile is not loading for users, but visible to admins due to a js error

    User profile is not loading for users, but visible to admins. Reason: javascript error in console when user opens their profile, but there is no error when an admin does it.
    We are getting the following error in the console:

    Click image for larger version

Name:	image.png
Views:	0
Size:	22.5 KB
ID:	125367

    We are getting the error when:
    . it's a normal user and there is salutationName present and the layout has the "Name" field:
    Click image for larger version

Name:	image.png
Views:	0
Size:	13.6 KB
ID:	125364

    We are NOT getting any error when:
    1. An admin user sees any user profile
    2. if a regular user sees the profile but salutationName​ is null. Error is only when salutationName​ is there.
    3. if the "name" field is removed from the layout and replaced with separate fields for salutationName​, firstName and lastName.

    We are using self hosted espocrm for about 15-16 months now, and we noticed this last month. It was working fine earlier.

    this is the role assigned to the normal users:

    Click image for larger version

Name:	image.png
Views:	0
Size:	343.8 KB
ID:	125366
    Attached Files
  • heint
    Member
    • Jun 2025
    • 75

    #2
    Greetings, crmtesting,

    Could you please specify what Espo version you are using? Also, has any customization been made to the User entity earlier?
    You can also check the debug mode for more possible information.

    Comment

    • shalmaxb
      Senior Member
      • Mar 2015
      • 1860

      #3
      It may have to do with a mix of reasons.
      1. obviously it is caused by an option in a salutation part of a person field. There are options prepoulated, when you set such field
      2. The error says, an option is missing. This may occur in case of a relationship established between person fields in two entities, where the options are set differently, may happen, if your system is not en_US, but another language. So one entity looks for the related option but it perhaps had been set in another language, thus not accessible.
      3. same could be valid for different options in different language files.
      4. Can be caused by ACL (Roles). It does not happen for admin, because they do not fall under roles.
      5. same for when no option is selected, than it does not affect the other field.

      Is there anything in data/logs?
      check your relationships and all person fields you use in your app, if there is any inconsistence in the salutation part.

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 9716

        #4
        Check the custom language file. It's likely the option translations for the salutation are stored as null.

        Comment

        Working...