Error 500 when accessing leads

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elir
    Junior Member
    • Jun 2015
    • 14

    Error 500 when accessing leads

    Hi again,

    Starting this morning after I have imported about 40 new leads and around 400 related emails,
    Every time I'm or any other user trying to see the Leads page it's shows "Error 500" and the page is empty, accounts and contacts working fine.

    This is the the relevant line in the Error log:

    Code:
      
    [2015-06-08 10:36:02] Espo.ERROR: API [GET]:/:controller, Params:Array
    (
        [controller] => Lead
    )
    , InputData:  - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC LIMIT 0, 40' at line 3 [] []
    [2015-06-08 10:36:02] Espo.ERROR: Display Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC LIMIT 0, 40' at line 3, Code: 42000 URL: /api/v1/Lead?maxSize=40&offset=0&sortBy=createdAccount&asc=true [] []
    Do you have an idea how to solve this? Thanks a lot, Eli
    Last edited by elir; 06-08-2015, 10:49 AM.
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi

    I have no idea. Did you try to do repair?
    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

    • elir
      Junior Member
      • Jun 2015
      • 14

      #3
      Yes I did several times, it didn't help.

      But finally, 5 minutes ago I found the solution after trying a lot of stuff.

      The problem was in the #Admin/entityManager > Edit Leads entity, the default order have to be on something different then "createdAccount" from some reason Lead? returns it empty while everything else returns with data.

      Thanks,
      Eli.

      Comment

      • SpeedBullet
        Senior Member
        • Mar 2016
        • 123

        #4
        I also have the same problem: error 500 when accessing "leads". Extra info: the dataset is empty (new installation) and the chosen language is Dutch. Changing the default order to something else doesn't seem to help. Also, creating a lead returns a 500 error.


        Edit: I checked the logs. There is an error on line 66 of Lead.php

        This is the code:

        PHP Code:
        public function afterCreate($entity, array $data, $data = array()) 
        
        Shouldn't this be
        PHP Code:
        public function afterCreate($entity, array $data = array()) 
        
        I checked the code for Contact.php and this is what it says there so I presume it's a typo. I tested this and it seems to work. Please reflect these changes in future versions... weird that only I have issues with this or what's going on?
        Last edited by SpeedBullet; 03-08-2016, 08:38 PM.

        Comment

        Working...