Loading reassign_user_content.module +18 −6 Original line number Diff line number Diff line Loading @@ -113,13 +113,25 @@ function reassign_user_content_user_cancel($edit, UserInterface $account, $metho * @see _user_cancel() */ function reassign_user_content_batch_alter(&$batch) { if (isset($batch['sets'][1]['operations'][0][0]) && $batch['sets'][1]['operations'][0][0] == '_user_cancel' && isset($batch['sets'][1]['operations'][0][1][2]) && $batch['sets'][1]['operations'][0][1][2] == 'user_cancel_reassign_content' $values = isset($batch['form_state']) ? $batch['form_state']->getValues() : []; // Only go over the bath sets if we come from the form-submit // of the user cancel form and our method was selected. if ( isset($values['user_cancel_method']) && $values['user_cancel_method'] === 'user_cancel_reassign_content' ) { // For every account that gets deleted, the batch was created. // Change all of them. foreach ($batch['sets'] as &$set) { if (isset($set['operations'][0][0]) && $set['operations'][0][0] == '_user_cancel' && isset($set['operations'][0][1][2]) && $set['operations'][0][1][2] == 'user_cancel_reassign_content' ) { // Change the batch operation callback. $batch['sets'][1]['operations'][0][0] = '_reassign_user_content'; $set['operations'][0][0] = '_reassign_user_content'; } } } } Loading Loading
reassign_user_content.module +18 −6 Original line number Diff line number Diff line Loading @@ -113,13 +113,25 @@ function reassign_user_content_user_cancel($edit, UserInterface $account, $metho * @see _user_cancel() */ function reassign_user_content_batch_alter(&$batch) { if (isset($batch['sets'][1]['operations'][0][0]) && $batch['sets'][1]['operations'][0][0] == '_user_cancel' && isset($batch['sets'][1]['operations'][0][1][2]) && $batch['sets'][1]['operations'][0][1][2] == 'user_cancel_reassign_content' $values = isset($batch['form_state']) ? $batch['form_state']->getValues() : []; // Only go over the bath sets if we come from the form-submit // of the user cancel form and our method was selected. if ( isset($values['user_cancel_method']) && $values['user_cancel_method'] === 'user_cancel_reassign_content' ) { // For every account that gets deleted, the batch was created. // Change all of them. foreach ($batch['sets'] as &$set) { if (isset($set['operations'][0][0]) && $set['operations'][0][0] == '_user_cancel' && isset($set['operations'][0][1][2]) && $set['operations'][0][1][2] == 'user_cancel_reassign_content' ) { // Change the batch operation callback. $batch['sets'][1]['operations'][0][0] = '_reassign_user_content'; $set['operations'][0][0] = '_reassign_user_content'; } } } } Loading