diff --git a/src/Entity/Index.php b/src/Entity/Index.php index 1347a75c..54b78b97 100644 --- a/src/Entity/Index.php +++ b/src/Entity/Index.php @@ -1357,7 +1357,8 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { if (!$use_batch || Utility::isRunningInCli()) { $index_task_manager->addItemsAll($this); } - else { + elseif (!defined('MAINTENANCE_MODE') + || (!in_array(MAINTENANCE_MODE, ['install', 'update']))) { $index_task_manager->addItemsBatch($this); } } diff --git a/src/Task/TaskManager.php b/src/Task/TaskManager.php index 606ce109..572ea3d1 100644 --- a/src/Task/TaskManager.php +++ b/src/Task/TaskManager.php @@ -288,6 +288,8 @@ public function processBatch(array $task_ids, array $conditions, &$context) { // Initialize context information. if (!isset($context['sandbox']['task_ids'])) { $context['sandbox']['task_ids'] = $task_ids; + } + if (!isset($context['results']['total'])) { $context['results']['total'] = $this->getTasksCount($conditions); }