Commit 8da49ba2 authored by catch's avatar catch
Browse files

Issue #3318581 by andypost, alexpott: FIx...

Issue #3318581 by andypost, alexpott: FIx \Drupal\Core\Config\ConfigImporter::doSyncStep() to accept callable
parent 83d2b0bc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -507,7 +507,7 @@ public function import() {
   *   Exception thrown if the $sync_step can not be called.
   */
  public function doSyncStep($sync_step, &$context) {
    if (!is_array($sync_step) && method_exists($this, $sync_step)) {
    if (is_string($sync_step) && method_exists($this, $sync_step)) {
      \Drupal::service('config.installer')->setSyncing(TRUE);
      $this->$sync_step($context);
    }
+1 −1
Original line number Diff line number Diff line
@@ -822,7 +822,7 @@ public function testInvalidStep() {
  public function testCustomStep() {
    $this->assertFalse(\Drupal::isConfigSyncing(), 'Before an import \Drupal::isConfigSyncing() returns FALSE');
    $context = [];
    $this->configImporter()->doSyncStep([self::class, 'customStep'], $context);
    $this->configImporter()->doSyncStep(\Closure::fromCallable([self::class, 'customStep']), $context);
    $this->assertTrue($context['is_syncing'], 'Inside a custom step \Drupal::isConfigSyncing() returns TRUE');
    $this->assertFalse(\Drupal::isConfigSyncing(), 'After an valid custom step \Drupal::isConfigSyncing() returns FALSE');
  }