Verified Commit 820c507c authored by quietone's avatar quietone
Browse files

Issue #2957279 by alexpott, pguillard, chr.fritsch, Wim Leers: Fix typo in...

Issue #2957279 by alexpott, pguillard, chr.fritsch, Wim Leers: Fix typo in locale_config_batch_refresh_name causing "[warning] No configuration objects have been updated."
parent 56c825fc
Loading
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -638,14 +638,14 @@ function locale_config_batch_set_config_langcodes(&$context) {
 * @see locale_config_batch_build()
 */
function locale_config_batch_refresh_name(array $names, array $langcodes, &$context) {
  if (!isset($context['result']['stats']['config'])) {
    $context['result']['stats']['config'] = 0;
  if (!isset($context['results']['stats']['config'])) {
    $context['results']['stats']['config'] = 0;
  }
  $context['result']['stats']['config'] += Locale::config()->updateConfigTranslations($names, $langcodes);
  $context['results']['stats']['config'] += Locale::config()->updateConfigTranslations($names, $langcodes);
  foreach ($names as $name) {
    $context['result']['names'][] = $name;
    $context['results']['names'][] = $name;
  }
  $context['result']['langcodes'] = $langcodes;
  $context['results']['langcodes'] = $langcodes;
  $context['finished'] = 1;
}

+18 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

namespace Drupal\FunctionalTests\Installer;

use Drupal\Core\Logger\RfcLogLevel;

/**
 * Verifies that installing from existing configuration works.
 *
@@ -21,4 +23,20 @@ protected function getConfigTarball() {
    return __DIR__ . '/../../../fixtures/config_install/multilingual.tar.gz';
  }

  /**
   * {@inheritdoc}
   */
  public function testConfigSync() {
    parent::testConfigSync();

    // Ensure no warning, error, critical, alert or emergency messages have been
    // logged.
    $count = (int) \Drupal::database()->select('watchdog', 'w')->fields('w')->condition('severity', RfcLogLevel::WARNING, '<=')->countQuery()->execute()->fetchField();
    $this->assertSame(0, $count);

    // Ensure the correct message is logged from locale_config_batch_finished().
    $count = (int) \Drupal::database()->select('watchdog', 'w')->fields('w')->condition('message', 'The configuration was successfully updated. %number configuration objects updated.')->countQuery()->execute()->fetchField();
    $this->assertSame(1, $count);
  }

}