Closed BobRay closed 11 years ago
bobray created Redmine issue ID 10216
This code returns an empty array in a plugin connected to OnBeforeDocFormSave:
$parents = $modx->getParentIds(2069); $p = print_r($parents, true); $modx->log(modX::LOG_LEVEL_ERROR, $p);
The code above works fine in a snippet. It looks like $modx->resourceMap is empty at that point.
The array is also empty when running outside of MODX after instantiating the $modx object.
I didn't try it in plugins connected to other events.
This makes it impossible to use getParentIds() in the plugin or any other method that requires the $resourceMap.
bobray submitted:
Calling $modx->reloadContext() doesn't help.
Never mind (close this guy).
getParentIds(2069, 10, array('context' => 'web'));
bobray created Redmine issue ID 10216
This code returns an empty array in a plugin connected to OnBeforeDocFormSave:
$parents = $modx->getParentIds(2069); $p = print_r($parents, true); $modx->log(modX::LOG_LEVEL_ERROR, $p);
The code above works fine in a snippet. It looks like $modx->resourceMap is empty at that point.
The array is also empty when running outside of MODX after instantiating the $modx object.
I didn't try it in plugins connected to other events.
This makes it impossible to use getParentIds() in the plugin or any other method that requires the $resourceMap.