We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7231
    • 4,205 Posts
    I have found a bug in PHx when setting custom manager user resource path. It turns out that it is because it is using $rb_base_dir to set the path to the include file as well as when locating the modifiers dir. Since there was no discussion regarding the code in the actual PHx support post I decided to post this here in the team section for now.

    According to the info that was offered in the original post...:
    http://modxcms.com/forums/index.php/topic,22976.msg144136.html#msg144136
    I found this out the hard way as well when I started programming my snippets to use $rb_base_path (rb = Resource Browser) instead of the proper $base_path.’assets/’.

    So to get it to work I needed to change in the phx.plugin.txt (or the code in the manager interface) file the first line of code reads:
    include_once $modx->config['rb_base_dir'] . "plugins/phx/phx.parser.class.inc.php";
    Change to:
    include_once $modx->config['base_path'] . "assets/plugins/phx/phx.parser.class.inc.php";


    and in phx.parser.class.inc.php @ line 298 change:
    $filename = $modx->config['rb_base_dir'] . 'plugins/phx/modifiers/'.$modifier_cmd[$i].'.phx.php';
    to this:
    $filename = $modx->config['base_path] . 'assets/plugins/phx/modifiers/'.$modifier_cmd[$i].'.phx.php';


    THis is tested to work on my test environment, but I am not sure that this is the best way to accomplish this, I’m still getting a handle on the modx variables.

    It is very ironic that I stumbled on this since I never use PHx and only have it installed in one of my test environments. It just so happened that I tested this feature on that one environment, otherwise I would not have noticed. shocked
      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

      Something is happening here, but you don't know what it is.
      Do you, Mr. Jones? - [bob dylan]
      • 22303 MODX Staff
      • 10,725 Posts
      It definitely should not be using rb_base_dir (that is a system setting related to the resource browser only, thus it begins with rb_).