Is runProcessor cached when executed within a loop? I'm trying to create multiple new user accounts by running 'security/user/create' inside a foreach loop, however it only creates the first user.
The error output just repeats the details of the first user inserted for every other record.
// $newusers = array containing new users (all required fields are set)
foreach ($newusers as $user) {
$props = array(
'newpassword' => true,
'passwordnotifymethod' => 's',
'passwordgenmethod' => 'g',
);
$props = array_merge($user,$props);
$response = $modx->runProcessor('security/user/create', $props);
$errors = $response->getAllErrors();
$output .= implode("\n",$errors);
}
I guess I could use xpdo to create the users but that seems pointless when a perfectly good processor is already in place...