On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi,

    I've just upgraded a site from Evolution 1.0.8 to Evolution 1.0.12 and it's broke.

    Initially the home page worked but all the other pages just returned "Error"

    So I thought it must be a Furl issue but then the home page also just comes up with "Error"

    In system events i get a message about Snippet - sendCacheControlHeader:

    Error : extract() [function.extract]: First argument should be an array

    This is really serious, has anyone any ideas what I can do?

    Cheers
    Mike [ed. note: thingstodo last edited this post 7 years, 9 months ago.]
    • sendCacheControlHeader is not a default Snippet or used. What does it do?

      BTW: If you are logged into the backend the frontend should show the full error message.
      • Hi Jako thanks for responding, I've managed to restore some pages by reverting to an older template!

        This is the full System Event error message:

        « MODX Parse Error »
        MODX encountered the following error while attempting to parse the requested resource:
        « PHP Parse Error »
        PHP error debug
        Error : extract() [function.extract]: First argument should be an array
        ErrorType[num] : WARNING[2]
        File : /home/webuyany/public_html/manager/includes/document.parser.class.inc.php
        Line : 1015
        Source : extract($error_info);
        Basic info
        REQUEST_URI : /blog
        Resource : [61]Blog
        Current Snippet : sendCacheControlHeader
        Referer : http://webuyanybike.com/
        User Agent : Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36
        IP : 87.194.146.45
        Benchmarks
        MySQL : 0.0033 s (6 Requests)
        PHP : 0.0328 s
        Total : 0.0360 s
        Memory : 3.88734436035 mb

        Backtrace

        1 DocumentParser->executeParser()
        index.php on line 140
        2 DocumentParser->prepareResponse()
        manager/includes/document.parser.class.inc.php on line 1568
        3 DocumentParser->parseDocumentSource()
        manager/includes/document.parser.class.inc.php on line 1658
        4 DocumentParser->evalSnippets()
        manager/includes/document.parser.class.inc.php on line 1450
        5 DocumentParser->_get_snip_result()
        manager/includes/document.parser.class.inc.php on line 1061
        6 DocumentParser->evalSnippet()
        manager/includes/document.parser.class.inc.php on line 1147
        7 extract()
        manager/includes/document.parser.class.inc.php on line 1015
        • sendCacheControlHeader is not a default MODX Evolution snippet. What does it do? Could you post the code? How it is called?
          • Ah right I'm calming down a bit now .... and am actually reading your question....

            This is what sendCacheControlHeader does


            header("Cache-Control: public");


            $date = new DateTime();
            $date->modify("+1 year");
            $expires = 'Expires '.$date->format("D, j M Y H:i:s").' GMT';
            header($expires); //
            • Getting rid of sendCacheControlHeader seems to have sorted it out....
              • This problem should be fixed with 1.0.13-RC2.

                I think your snippet sendCacheControlHeader does not work properly. Maybe DateTime() class is not available.

                Try it with:
                header('Cache-Control: public'); 
                header('Expires ' . strftime('%a, %1 %b %Y %H:%M:%S', strtotime('+1 year')) . ' GMT');
                

                • OK, panic over, it was that snippet that was causing the problems.

                  There are one or two other less serious issues but I'll start another thread about those.

                  And will try your suggested code when I iron everything else out.

                  Thanks
                  • Quote from: Jako at Jan 28, 2014, 10:26 AM
                    This problem should be fixed with 1.0.13-RC2.

                    I think your snippet sendCacheControlHeader does not work properly. Maybe DateTime() class is not available.

                    Try it with:
                    header('Cache-Control: public'); 
                    header('Expires ' . strftime('%a, %1 %b %Y %H:%M:%S', strtotime('+1 year')) . ' GMT');
                    


                    Yes, that worked and stopped the error caused by the previous code.

                    Thanks again for your help.

                    Mike