api error on get template

Discussion in 'Common issues' started by franco, Jul 17, 2019.

  1. franco

    franco New Member

    Joined:
    Jun 27, 2019
    Messages:
    5
    Likes Received:
    0
    S.E:
    2019-12-26 09:57:09
    L.T:
    Regular
    L.C:
    1
    Hi
    when calling API getTemplate('template-id') I get this error request.php (api)
    "{\"status\":\"error\",\"error\":\"CHttpSession and its behaviors do not have a method or closure named "setCacheLimiter".\"}"
    dont know to to fix it...
    search around without success.
    Anyone get same issue and fix it?

    thank
     
  2. laurentiu

    laurentiu Active Member Staff Member

    Joined:
    Mar 13, 2018
    Messages:
    242
    Likes Received:
    30
  3. franco

    franco New Member

    Joined:
    Jun 27, 2019
    Messages:
    5
    Likes Received:
    0
    S.E:
    2019-12-26 09:57:09
    L.T:
    Regular
    L.C:
    1
    Hi thank Laurentiu
    I follow exactly the api.docs guide and was able to use api for subscriber, ect.
    but fail with getTemplate (as reported before...)
    curl http method post and get work, so dont know where to find solution
    thank
     
  4. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,255
    Likes Received:
    2,382
    @franco - the CHttpSession class is defined in /apps/common/framework/web/CHttpSession.php and in the file, last method is
    setCacheLimiter so the method exists.

    What version of the app are you using? if not latest, can you upgrade?
     
  5. franco

    franco New Member

    Joined:
    Jun 27, 2019
    Messages:
    5
    Likes Received:
    0
    S.E:
    2019-12-26 09:57:09
    L.T:
    Regular
    L.C:
    1
    Hi just upgrade from 1.7.5 to 1.8.1 but error still remain
    I did already check on class CHttpSession.php for setCacheLimiter and found it...
     
  6. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,255
    Likes Received:
    2,382
    Okay, try to also restart PHP. Sometimes if you are using PHP under FPM with opcode enabled, it will cache your code and would result in issues like this, so a PHP Restart or Web Server restart might fix it.
     
  7. franco

    franco New Member

    Joined:
    Jun 27, 2019
    Messages:
    5
    Likes Received:
    0
    S.E:
    2019-12-26 09:57:09
    L.T:
    Regular
    L.C:
    1
    Try to restart but no way!
    please find attach screenshot (i'm using phpEd for debugging)
     

    Attached Files:

  8. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,255
    Likes Received:
    2,382
    I think you're doing the changes in a place then checking them in another one...
    Can you open a support ticket with backend url and login to your app and also ftp access so that we can check this?
     
  9. franco

    franco New Member

    Joined:
    Jun 27, 2019
    Messages:
    5
    Likes Received:
    0
    S.E:
    2019-12-26 09:57:09
    L.T:
    Regular
    L.C:
    1
    ok thk will do
     

Share This Page