Weird bug in Preferences

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • azidevnom
    Junior Member
    • Oct 2019
    • 20

    Weird bug in Preferences

    Hello, we have the weirdest bug that has been carried on for ages now, which crashes the preferences view. It happens up to version 8.3.5 and affects old accounts. New accounts seems not to be affected. I have not been able to reproduce this error in other instances. Currently we are running 8.3.5 with docker.

    This error shows in the browser console. The preferences view does not show.

    Click image for larger version

Name:	image.png
Views:	115
Size:	23.6 KB
ID:	109123

    ​I managed to track this error down to the espo-main.js file in client/lib on Line 35, Col 302019.
    I added the trusty old console.log before the statement to see what is happening.

    Click image for larger version

Name:	image.png
Views:	55
Size:	25.9 KB
ID:	109124

    And here is the one "array" to blame.

    Click image for larger version

Name:	image.png
Views:	56
Size:	41.2 KB
ID:	109125

    Clearly this forEach cannot be used on {0: 'Meeting', 1: 'Call', 2: 'Email', 3: 'BpmnUserTask', 5: 'Task'}, so I just applied a little fix to see if it works now.

    Click image for larger version

Name:	image.png
Views:	56
Size:	26.7 KB
ID:	109126

    ....Aaaand voilá, now the error does not happen and the preferences view is finally shown.

    Click image for larger version

Name:	image.png
Views:	55
Size:	21.7 KB
ID:	109127​​

    ​​Anyways... of course this fix will not survive upgrades, so... does anyone knows where does that object ({0: 'Meeting'...}) is coming from?

    Thanks for listening to my TED talk.

    (PS. I took more screenshots but only a maximum of 5 are allowed)
  • yuri
    Member
    • Mar 2014
    • 8444

    #2
    The question is how it happened that an Object got stored instead of array. What field is it? "assignmentNotificationsIgnoreEntityTypeList" ?
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • yuri
      Member
      • Mar 2014
      • 8444

      #3
      Maybe a non array (or non-list) value is set it data/config.php.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      • azidevnom
        Junior Member
        • Oct 2019
        • 20

        #4
        yuri thanks for your guidance. I now can see clearly where was the problem. It was this array in data/config shown in the screenshot, which had a wrong last index, god knows why. I corrected it and everything works just fine now.

        Click image for larger version

Name:	image.png
Views:	78
Size:	9.0 KB
ID:	109157

        I checked everywhere but data/co​nfig, even the preferences object stored in the database, and seems that I took the hardest path to debugging it .

        Thank you very much again, yuri.

        Comment

        • yuri
          Member
          • Mar 2014
          • 8444

          #5
          It could be caused either by some old bug (that might have been fixed long ago) or the "4" line was removed manually by a human.
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          Working...