We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23018
    • 353 Posts
    I have found this messege in my error log:

    [2012-02-23 10:31:22] (ERROR @ .../core/cache/includes/elements/modsnippet/44.include.cache.php : 261) PHP warning: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed

    Any advide how I can use this information to efficiently track down the culprit?

    Kind regards,

    pepebe
      Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
      • 38494
      • 13 Posts
      how is it being triggered? is your caching functioning ok & is your host able to deal with the modx requirements?
        • 23018
        • 353 Posts
        @kn00tcn: Thanks you for advice. In the meantime I have looked up the file mentioned in the error log and found out rhe error is related to MIGX.

        It's a bit embarrassing that i didn't think about that before I wasted anyone (especially your) time. Probably lack of sleep...

        Thanks anyway.

        Regards,

        pepebe
          Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
          • 38705
          • 101 Posts
          Hi Pepebe,

          1: browse your server and go to /core/cache/includes/elements/modsnippet/
          2: open the file 44.include.cache.php and look at the code that has been produced there.

          3: Go to your snippets area and track down the snippet that produces the above code.
          4: Repair your implode()-issue there
          5: Save your snippet (+ clear cache) (this will produce a new xx.include.cache.php file)
          6: Try again!

          Cheers, Michiel
            Addict since 2012....
            • 38494
            • 13 Posts
            time is not wasted when something is solved
              • 25803 ☆ A M B ☆
              • 721 Posts
              What was the solution? We get this error constantly and it really builds up a huge error file.
                • 3749
                • 24,544 Posts
                implode() craps out if the second argument is not an array or is not set.

                One fix would be to find any implode() calls in the snippet referenced in the error message and fix them like this:

                Change this:
                implode(whatever, $something);


                To this:
                if (! isset($something) || ! is_array($something)) {
                     $something = array();
                }
                implode(whatever, $something);


                Note that the implode call itself does not change. Replace $something in your new code with whatever is the second argument to implode().

                That won't fix whatever is sending implode() the bad argument, but it should eliminate the error messages.


                ------------------------------------------------------------------------------------------
                PLEASE, PLEASE specify the version of MODX you are using.
                MODX info for everyone: http://bobsguides.com/modx.html
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting