Announcement

Collapse
No announcement yet.

Preferences "system" from everyone

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Preferences "system" from everyone

    Hello there,

    I currently am trying to fix a problem about the preferences system of espo, I always get the preferences of the "system", even if my user have registered preferences in my database.
    What I get from this route (api/v1/App/user) is this
    Click image for larger version

Name:	image.png
Views:	254
Size:	55.6 KB
ID:	82476

    and as you can see this isn't my user's preferences but the global preferences.
    So if anyone knows how to fix this I'll be happy to hear how to fix it.​


    King regards,
    Firyo.

  • #2
    Hi Firyo,

    Try using a request like this:
    Code:
    https://your-espo-url/api/v1/Preferences/[your_user_id]

    Comment


    • #3
      Have never encountered this problem before.

      Comment


      • #4
        Originally posted by lazovic View Post
        Hi Firyo,

        Try using a request like this:
        Code:
        https://your-espo-url/api/v1/Preferences/[your_user_id]
        Thanks for your answer,
        This URL returns the user's preferences so It's fine on this one.

        The problem that I have is that by default the "/api/v1/App/user" route gives me the system preferences everytime.
        The current user preferences are like bypassed by the system's.

        I started digging into the PHP code that handles this request and the preferences are coming from the function getValueMap() from the entity Espo\Entities\Preferences.
        Last edited by Firyo; 09-05-2022, 12:46 PM.

        Comment


        • #5
          Firyo,

          Very strange. On EspoCRM version 7.1.11, the Preferences mapping through /api/v1/App/user request looks like this:

          Click image for larger version

Name:	11.png
Views:	206
Size:	63.9 KB
ID:	82620Click image for larger version

Name:	12.png
Views:	205
Size:	105.9 KB
ID:	82619

          Comment


          • #6
            Originally posted by lazovic View Post
            Firyo,

            Very strange. On EspoCRM version 7.1.11, the Preferences mapping through /api/v1/App/user request looks like this:

            Click image for larger version  Name:	11.png Views:	0 Size:	63.9 KB ID:	82620Click image for larger version  Name:	12.png Views:	0 Size:	105.9 KB ID:	82619
            I'm also on the version 7.1.11.

            I've added a line of code in the getUserData function of Services/App.php and It's working well (even if It's not the best way of doing it I think)
            Click image for larger version

Name:	image.png
Views:	121
Size:	35.5 KB
ID:	82624
            Attached Files

            Comment

            Working...
            X