We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28840
    • 46 Posts
    I have a CMP which includes a TinyMCE field for richtext content. When I send the data I see the "post" from Firebug:
    action	mgr/mails/update
    content	<p>content ftw</p> <p>[[+link_5]]</p>

    And the placeholder is sent ([[+link_5]])!

    But when I print the $_REQUEST var on the connector I get:

    Array
    (
        [action] => mgr/mails/update
        [id] => 1
        [field] => basic
        [HTTP_MODAUTH] => XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        [subject] => subject
        [content] => 
    
    content ftw
    
    
        [resource] => 0
        [ext-comp-1053] => 20
    )


    I know that MODx parses the $_GET & $_POST strings into one $_REQUEST string but how come that it processes the placeholders before any "processor" is called?

    Sumoborac
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Try var_dump instead of print_r, it looks like the html tags are being seen as html too instead of showing the actual tags.

      The connector can be stripping MODX tags for security reasons, but by default it will not do that for the mgr context and if you set up the connector properly, it should be using the mgr context. Can you show your connector code?
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 28840
        • 46 Posts
        var_dump gives the same data... no placeholders...

        I have temporary solved the problem with setting another var that saves the "content" post field before MODx is set up.
        if(isset($_REQUEST['content'])) $tmp_content = $_REQUEST['content'];
        
        require_once dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/config.core.php';
        require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php';
        require_once MODX_CONNECTORS_PATH.'index.php';
        
        $corePath = $modx->getOption('aSES.core_path',null,$modx->getOption('core_path').'components/aSES/');
        require_once $corePath.'model/aSES/ases.class.php';
        
        $modx->addPackage('aSES',$corePath.'model/');
        $modx->aSES = new aSES($modx);
        /*
        $manager= $modx->getManager();
        $generator= $manager->getGenerator();
        $manager->createObjectContainer('asesLinks');
        */
        $modx->lexicon->load('aSES:default');
        /* handle request */
        if(isset($tmp_content)) $_REQUEST['content'] = $tmp_content;
        $path = $modx->getOption('processorsPath',$modx->aSES->config,$corePath.'processors/');
        $modx->request->handleRequest(array(
            'processors_path' => $path,
            'location' => '',
        ));

        If i do print_r/var_dump before require_once MODX_CONNECTORS_PATH.'index.php'; then I see the placeholder. After this line...no more.

        Any advice?

        Sumoborac