Commit 0c707fd3 authored by catch's avatar catch
Browse files

Issue #3173991 by alexpott, andypost, Gábor Hojtsy, hussainweb: Incorrect...

Issue #3173991 by alexpott, andypost, Gábor Hojtsy, hussainweb: Incorrect passby reference use in anonymous functions
parent 2d8c912c
Loading
Loading
Loading
Loading
+1 −1
Changes for core/modules/language/src/Plugin/Condition/Language.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ public function summary() {
    $language_list = $this->languageManager->getLanguages(LanguageInterface::STATE_ALL);
    $selected = $this->configuration['langcodes'];
    // Reduce the language list to an array of language names.
    $language_names = array_reduce($language_list, function (&$result, $item) use ($selected) {
    $language_names = array_reduce($language_list, function ($result, $item) use ($selected) {
      // If the current item of the $language_list array is one of the selected
      // languages, add it to the $results array.
      if (!empty($selected[$item->getId()])) {
+1 −1
Changes for core/modules/migrate_drupal/src/MigrationState.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ public function getUpgradeStates($version, array $source_system_data, array $mig
  protected function getMigrationStates() {
    // Always instantiate a new YamlDiscovery object so that we always search on
    // the up-to-date list of modules.
    $discovery = new YamlDiscovery('migrate_drupal', array_map(function (&$value) {
    $discovery = new YamlDiscovery('migrate_drupal', array_map(function ($value) {
      return $value . '/migrations/state';
    }, $this->moduleHandler->getModuleDirectories()));
    return $discovery->findAll();
+1 −1
Changes for core/modules/migrate_drupal/tests/src/Kernel/StateFileExists.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ public function testMigrationState() {
    $this->enableModules($modules_to_enable);

    // Modules with a migrate_drupal.yml file.
    $has_state_file = (new YamlDiscovery('migrate_drupal', array_map(function (&$value) {
    $has_state_file = (new YamlDiscovery('migrate_drupal', array_map(function ($value) {
      return $value . '/migrations/state';
    }, $module_handler->getModuleDirectories())))->findAll();

+1 −1
Changes for core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ public function testMigrationState() {
    // destination is not used yet but can be later for validating the
    // source/destination pairs with the actual source/destination pairs in the
    // migrate plugins.
    $system_info = (new YamlDiscovery('migrate_drupal', array_map(function (&$value) {
    $system_info = (new YamlDiscovery('migrate_drupal', array_map(function ($value) {
      return $value . '/migrations/state/';
    }, \Drupal::moduleHandler()->getModuleDirectories())))->findAll();