I'm having a hard time figuring out how to push the post from the connector file to the processor in the web context. It seems like a no brainer after putting together the manager, but I'm just missing something.
My connector:
require_once 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('addon.core_path',null,$modx->getOption('core_path').'components/addon/');
require_once $corePath.'model/addon/addon.class.php';
$modx->addon= new Addon($modx);
$modx->lexicon->load('addon:default');
/* handle request */
$path = $modx->getOption('processorsPath',$modx->addon->config,$corePath.'processors/');
$modx->request->handleRequest(array(
'processors_path' => $path,
'location' => '',
));
And my JQuery that executes my post:
$('#fileupload').bind('fileuploadsend', function (e, data) {
if (data.dataType.substr(0, 6) === 'iframe') {
var target = $('<a/>').prop('href', data.url)[0];
if (window.location.host !== target.host) {
data.formData.push({
name: 'redirect',
value: redirectPage,
action:'web/items/create'
});
}
}
});
And I placed just a simple error logging in the processor file:
$modx->log(modX::LOG_LEVEL_ERROR,'[addon] loaded create processor');
return 'test';
While it runs the code in my connector ( I placed the same error post while I was testing ), it never makes it to my processor. I have tried changing the processor file name to create.class.php, even calling 'web/items/create.php' in the javascript. I've been working on this off and on for days, and I just need someone smarter than me to tell me what I'm doing wrong.