Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the fix for PR 5869 to the 12.x branch #6208

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/Commands/config/ConfigImportCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,23 +260,17 @@ public function doImport($storage_comparer): void
if (isset($context['message'])) {
$this->logger()->notice(str_replace('Synchronizing', 'Synchronized', (string)$context['message']));
}

// Installing and uninstalling modules might trigger
// batch operations. Let's process them here.
// @see \Drush\Commands\pm\PmCommands::install()
if ($step === 'processExtensions' && batch_get()) {
drush_backend_batch_process();
}
} while ($context['finished'] < 1);
}
// Clear the cache of the active config storage.
$this->getConfigCache()->deleteAll();
}

if ($config_importer->getErrors()) {
throw new ConfigException('Errors occurred during import');
} else {
$this->logger()->success('The configuration was imported successfully.');
}

$this->logger()->success('The configuration was imported successfully.');
} catch (ConfigException $e) {
// Return a negative result for UI purposes. We do not differentiate
// between an actual synchronization error and a failed lock, because
Expand All @@ -288,6 +282,13 @@ public function doImport($storage_comparer): void

watchdog_exception('config_import', $e);
throw new \Exception($message, $e->getCode(), $e);
} finally {
// Importing config might trigger batch operations (such as when installing and uninstalling modules).
// @see \Drush\Commands\pm\PmCommands::install()
if (batch_get()) {
$this->logger()->notice('Running batch operations...');
drush_backend_batch_process();
}
}
}
}
Expand Down