diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php index f27f91b..948330c 100644 --- a/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -44,7 +44,7 @@ class ConfigImporter { /** * The name used to identify the lock. */ - const LOCK_ID = 'config_importer'; + const LOCK_NAME = 'config_importer'; /** * The storage comparer used to discover configuration changes. @@ -512,9 +512,9 @@ public function initialize() { // Ensure that the changes have been validated. $this->validate(); - if (!$this->lock->acquire(static::LOCK_ID)) { + if (!$this->lock->acquire(static::LOCK_NAME)) { // Another process is synchronizing configuration. - throw new ConfigImporterException(sprintf('%s is already importing', static::LOCK_ID)); + throw new ConfigImporterException(sprintf('%s is already importing', static::LOCK_NAME)); } $sync_steps = array(); @@ -611,7 +611,7 @@ protected function processConfigurations(array &$context) { protected function finish(array &$context) { $this->eventDispatcher->dispatch(ConfigEvents::IMPORT, new ConfigImporterEvent($this)); // The import is now complete. - $this->lock->release(static::LOCK_ID); + $this->lock->release(static::LOCK_NAME); $this->reset(); $context['message'] = t('Finalizing configuration synchronization.'); $context['finished'] = 1; @@ -996,7 +996,7 @@ protected function importInvokeRename($collection, $rename_name) { * TRUE if an import is already running, FALSE if not. */ public function alreadyImporting() { - return !$this->lock->lockMayBeAvailable(static::LOCK_ID); + return !$this->lock->lockMayBeAvailable(static::LOCK_NAME); } /** diff --git a/core/modules/config/src/Tests/ConfigImportUITest.php b/core/modules/config/src/Tests/ConfigImportUITest.php index 1773e7f..2c93dd4 100644 --- a/core/modules/config/src/Tests/ConfigImportUITest.php +++ b/core/modules/config/src/Tests/ConfigImportUITest.php @@ -228,14 +228,14 @@ function testImportLock() { // Acquire a fake-lock on the import mechanism. $config_importer = $this->configImporter(); - $this->container->get('lock.persistent')->acquire($config_importer::LOCK_ID); + $this->container->get('lock.persistent')->acquire($config_importer::LOCK_NAME); // Attempt to import configuration and verify that an error message appears. $this->drupalPostForm(NULL, array(), t('Import all')); $this->assertText(t('Another request may be synchronizing configuration already.')); // Release the lock, just to keep testing sane. - $this->container->get('lock.persistent')->release($config_importer::LOCK_ID); + $this->container->get('lock.persistent')->release($config_importer::LOCK_NAME); // Verify site name has not changed. $this->assertNotEqual($new_site_name, \Drupal::config('system.site')->get('name'));