We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30045
    • 26 Posts
    have built a few modx sites now, but this is my first snippitization -unfortunately one I need to make happen soonish.

    have installed ajaxsearch 1.702 to modx 0.96, by replacing the code of an earlier version of the ajax search snippet, and putting a call to the snippet in a test template

    When i’m going to the page I’m getting:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
      Error: Unknown(MODX_MANAGER_PATH/includes/protect.inc.php): failed to open stream: No such file or directory
      Error type/ Nr.: Warning - 2
      File: /home/musictherapy/musictherapy.org.nz/manager/includes/document.parser.class.inc.php(766) : eval()’d code
      Line: 22

    Parser timing
      MySQL: 0.0322 s (5 Requests)
      PHP: 0.0874 s
      Total: 0.1196 s



    I put the standard snippet call in my template:

    [!AjaxSearch? &AS_showResults=`0` &AS_landing=`17` &showMoreResults=`1` &moreResultsPage=`17`!]

    the test page is at:
    http://musictherapy.org.nz/index.php?id=14

    I’d be grateful for any advice

    thanks



      one planet, one chance
    • Check your config.inc.php file to make sure the MODX_MANAGER_PATH has been defined there. You should not see that in the path, you should see the actual path to your manager folder.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 30045
        • 26 Posts
        thanks very much for this susan - interesting - yes the config path was wrong (a while ago moved the modx files out of a /cms subfolder to the site root), but having fixed this in the config, i still get :

        « MODx Parse Error »
        MODx encountered the following error while attempting to parse the requested resource:
        « PHP Parse Error »

        PHP error debug
        Error: Unknown(MODX_MANAGER_PATH/includes/protect.inc.php): failed to open stream: No such file or directory
        Error type/ Nr.: Warning - 2
        File: /home/musictherapy/musictherapy.org.nz/manager/includes/document.parser.class.inc.php(766) : eval()’d code
        Line: 22


        I’ve done a search of all the other files for any other incorrect pathing and haven’t been able to find anything else referring to the old /cms subfolder.

        Dare I ask..any other ideas?
          one planet, one chance
        • It’s not a matter of a wrong path, it’s that the constant MODX_MANAGER_PATH is not set when that is happening. If it were set, then you’d get the path instead of the text MODX_MANAGER_PATH. So either it’s not set in the config.inc.php file, or the config.inc.php file is not included at that point.

          if (!defined('MODX_MANAGER_PATH')) define('MODX_MANAGER_PATH', $base_path.'manager/');
          
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 30045
            • 26 Posts
            ta - i have to admit this is beyond my almost nonexistent php knowledge - but I’ll blag some local help to follow this up and I’m sure we’ll get there.

            in the meantime going back to version 1.1 is working - which will be fine for now and I’ll (well, my client will) defer gratification for the joys of 1.7

            thanks again
              one planet, one chance
              • 27733
              • 99 Posts
              You may already have this covered but, depending on which version of AS you we’re upgrading from, you may want to double-check the name of the AS directory in your assets/snippets/ folder ... a very slight change to the casing was made recently from "AjaxSearch" to "ajaxSearch"—make sure the directory name begins with a lowercase "a."
                ------
                Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.