We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34213
    • 32 Posts
    For some reason out of nowhere my site is pulling some error.
    The site is alsministries.com
    some error I can’t seem to fix or find the fix for. The error comes up when you go to the site
    Thank you in advance
      • 33997
      • 150 Posts
      I’ve dealt with this before I believe. You need to go into the file that it tells you

      /manager/includes/document.parser.class.inc.php
      Line 2
      and change split() to preg_split() (leave the stuff inside the parentheses alone). When you are upgrading to a system that is using PHP 5.3 or above, you need to change some of the code that may be deprecated. You can do a search online and find the replacements for any other commands that throw up error flags, I usually search for the command and php. For instance, here the function is split(), so I Googled ’split php’ and got the page in PHP.net

      http://www.php.net/manual/en/function.preg-split.php
      http://php.net/manual/en/function.split.php

      Enjoy!
        "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
        • 33997
        • 150 Posts
        Oh yeah, you can also do a find and replace; be warned, if you do one site wide you want your search query to be exact as possible, so try including the early space and the trailing parenthesis; i.e. you should FIND (minus the quote marks): ’ split(’ and REPLACE: ’ preg_split(’ if that makes sense.
          "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
          • 34213
          • 32 Posts
          Thank you for the response
          I am trying that now
          Will post with results
            • 34213
            • 32 Posts
            Ok I checked the file and Line 2 like it said but there is nothing in line 2

            <?php
            /**
            * MODx Document Parser
            * Function: This class contains the main document parsing functions
            *
            */

            This is line 1-6
              • 33997
              • 150 Posts
              Did you end up finding where it had the split() function? I see the site is working again....
                "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
                • 34213
                • 32 Posts
                I didn’t find it.
                For some reason my side bars disappeared and now i’m getting Parse errors?

                Here is the error:
                Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING in /home/xnszzspu/public_html/manager/includes/document.parser.class.inc.php(814) : eval()’d code on line 2

                Here are the lines in the file. 1-6

                <?php
                /**
                * MODx Document Parser
                * Function: This class contains the main document parsing functions
                *
                */

                How can there be an error???
                  • 4310
                  • 2,310 Posts
                  eval()'d code on line 2

                  Is referring to Line 2 of the snippet that’s causing the problem.
                  Try disabling any snippets on that page one by one until you find the offender.
                  Then it will be a question of modifying the snippet to replace the split() function.
                    • 34213
                    • 32 Posts
                    OHHH ok thank you I thought it was the file.
                    This is what I get for learning drupal, joomla, and wordpress
                    They are nothing like Modx
                      • 34213
                      • 32 Posts
                      When I edit this snippet is when it gives me my errors. Any ideas?

                      chunkListParser

                      <?php
                      $ar_chunks = explode(\’,\’,$chunks);
                      $ar_chunks = array_unique($ar_chunks);

                      $output = \\\’\\\’;

                      foreach ($ar_chunks as $chunk) {
                      if ($chunk != \\\’\\\’) {
                      $c = $modx->getChunk($chunk);
                      if ($c) $output .= $c;
                      }
                      }

                      if ($output != \\\’\\\’ && isset($wrapperdiv)) {
                      $output = \\\’<div id=\\\"\\\’.$wrapperdiv.\\\’\\\">\\\’.$output.\\\’</div>\\\’;
                      }

                      return $output;
                      ?>