modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

$modx->resourceMap empty in plugin #10216

Closed BobRay closed 11 years ago

BobRay commented 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 commented 11 years ago

bobray submitted:

Calling $modx->reloadContext() doesn't help.

BobRay commented 11 years ago

bobray submitted:

Never mind (close this guy).

getParentIds(2069, 10, array('context' => 'web'));