Results 1 to 12 of 12

Thread: json.parse error

  1. #1
    New user
    Join Date
    02-06-10.
    Posts
    25

    Default json.parse error

    Hi!
    I have one problem with contao 2.10. I have updated from 2.9.5 (without any problem) but when I try to enable "background" in css editor, get one JSON.parse error. Picture is in attachment.
    Please help me to solve this problem!
    Regards, Goran

  2. #2

    Default Re: json.parse error

    hi there,
    As I have opened a ticket here :http://dev.contao.org/issues/3369
    Try changing the line
    Code:
    $blnIsOpen = ($session[$node][$tid] 1 || count(preg_grep('/^' . preg_quote($currentFolder, '/') . '\//', $this->varValue)) > 0);
    to
    Code:
    $blnIsOpen = ($session[$node][$tid] 1 || count(preg_grep('/^' . preg_quote($currentFolder, '/') . '\//', (is_array($this->varValue) ? $this->varValue : array()))) > 0);
    in file system/modules/backend/FileTree.php about line no. 319. Hope it solves the issue.
    OM MANI PEME HUNG! how many has to die for freedom and dignity. Save this world

  3. #3
    New user
    Join Date
    02-06-10.
    Posts
    25

    Default Re: json.parse error

    Hi
    O.K. I have fixed :-)
    thank you, regards

  4. #4
    New user
    Join Date
    09-06-11.
    Posts
    2

    Default Re: json.parse error

    hey,

    I have the same problem. I changed the line, but it didn't work
    the error still appears. what else can I do?
    please help

  5. #5
    User
    Join Date
    01-20-11.
    Location
    Germany
    Posts
    77

    Default Re: json.parse error

    Hello,

    which PHP version do you use? I had this error message when using PHP 5.1 while Contao needs 5.2 as minimum requirement.

    Jan
    Free support only here in the forum.
    Please report bugs for my extensions using http://www.contao-forge.org. Thanks!
    Requests for Contao support and development please send mail to jan@theofel.de

  6. #6
    New user andypillip's Avatar
    Join Date
    08-26-11.
    Location
    Munich, Germany
    Posts
    7

    Default Re: json.parse error

    Hello there.

    I also got this problem.

    I tried to change that line — without any success.

    And on my server it's PHP Version 5.2.17 running.

    It's quite likely that there's some uncaught exception causing output in the AJAX response. How can I debug the AJAX requests, maybe with FireBug?

  7. #7
    New user andypillip's Avatar
    Join Date
    08-26-11.
    Location
    Munich, Germany
    Posts
    7

    Default Re: json.parse error

    So folks.

    Using the network tab of FireBug you can check all site's XHR traffic. I opened the tab and then clicked to expand the folder.

    I saw the request in FireBug and checked the answer.

    And as expected it's returning a PHP error:
    Code:
    Fatal error:  Out of memory (allocated 31457280) (tried to allocate 2953 bytes) in …/system/libraries/Controller.php on line 1026

  8. #8
    New user andypillip's Avatar
    Join Date
    08-26-11.
    Location
    Munich, Germany
    Posts
    7

    Default Re: json.parse error

    In my case the problem was a picture in the folder with the size of 2053 x 1965 px².

    When listing images (both in the back and the frontend) Contao is generating a thumbnail for the file list as well as for f.e. galleries.

    Generating a thumbnail is quite memory consuming.

    Contao got the following settings
    Code:
    $GLOBALS['TL_CONFIG']['gdMaxImgWidth']
    $GLOBALS['TL_CONFIG']['gdMaxImgHeight']
    to control which images to try to resize. Their default value is 3000.

    I needed to change this setting to a lower value. This value depends on the memory that your provider is offering.

    Does this help anyone?

  9. #9
    New user
    Join Date
    09-08-11.
    Location
    Mannheim
    Posts
    1

    Default Re: json.parse error

    After the Update I got almost the same Problem - Parse Error when I wanna open a Folder...

    Just checked with the network tab of FireBug - XHR traffic and got this one here:



    Fatal error: Call to undefined function json_encode() in /var/www/vhosts/tssports.de/httpdocs/system/modules/backend/Ajax.php on line 285


    any ideas what could help me solving the Problem?

  10. #10
    loumaran
    Gast

    Default Re: json.parse error

    Hi,

    I have the same problem. I didn't upgrade but it's a new installation of contao.

    Trying the solution of the first post, some Modules like "Downloads" didn't work anymore.

    Doesn't have anybody the same problem or maybe a solution?

  11. #11
    New user
    Join Date
    02-06-10.
    Posts
    25

    Default Re: json.parse error

    just manually upload all files of new version

  12. #12
    New user
    Join Date
    02-25-10.
    Posts
    24

    Default Re: json.parse error

    I fight with this after upgrading from Contao 2.9.1 to 2.10.4 manually
    everything else was fine but I also got the json error.

    My server has PHP version 5.2.9, however firebug detect a call to a missing function "json_encode".

    I have added the function found here:
    http://www.stetsenko.net/2009/09/php-js ... ore-5-2-0/
    at the bottom of the file "/system/functions.php", it works fine now.

    I have no old modules running, only the catalog extension.
    It works fine for the moment.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •