I programmatically create resources using $modx->newObject('modResource') then clear the cache using $modx->cacheManager->refresh();
I can see those new resources in the manager but the link using [[~theNewResourceID]] are not working unless I clear the cache using Modx manager.
Checked core/cache/context_settings/web/context.cache.php, the array aliasMap in that file is only updated when I'm using the manager....
Any suggestions?
I'm using 2.2.7
Tried also:
$modx->cacheManager->refresh(array(
'context_settings' => array('contexts' => array('web'))
));
Thanks
alain
Try this:
$modx->reloadContext('web');
thanks but still not working.
That really should do it, but I guess you could try unlinking the aliasMap file.