diff --git a/core/includes/theme.inc b/core/includes/theme.inc index b4b64474a6..75311c488e 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1153,7 +1153,7 @@ function template_preprocess_item_list(&$variables) { // \Drupal\Core\Render\Element::children(), which cannot be used // here, since it triggers an error on string values. foreach ($child as $child_key => $child_value) { - if ($child_key[0] !== '#') { + if (is_int($child_key) || $child_key === '' || $child_key[0] !== '#') { $child['#items'][$child_key] = $child_value; unset($child[$child_key]); } diff --git a/core/lib/Drupal/Core/Routing/CompiledRoute.php b/core/lib/Drupal/Core/Routing/CompiledRoute.php index 652acc5bb4..58498ce455 100644 --- a/core/lib/Drupal/Core/Routing/CompiledRoute.php +++ b/core/lib/Drupal/Core/Routing/CompiledRoute.php @@ -143,23 +143,22 @@ public function getRequirements() { /** * {@inheritdoc} */ - public function serialize() { + public function __serialize(): array { // Calling the parent method is safer than trying to optimize out the extra // function calls. - $data = unserialize(parent::serialize()); + $data = parent::__serialize(); $data['fit'] = $this->fit; $data['patternOutline'] = $this->patternOutline; $data['numParts'] = $this->numParts; - return serialize($data); + return $data; } /** * {@inheritdoc} */ - public function unserialize($serialized) { - parent::unserialize($serialized); - $data = unserialize($serialized); + public function __unserialize(array $data): void { + parent::__unserialize($data); $this->fit = $data['fit']; $this->patternOutline = $data['patternOutline']; diff --git a/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php b/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php index 844fb858b5..d8308c72b4 100644 --- a/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php +++ b/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php @@ -70,7 +70,13 @@ public function prepareRow(Row $row) { $query->condition('lt.language', $language); $query->addField('lt', 'translation'); $results = $query->execute()->fetchAssoc(); - $row->setSourceProperty($other_property . '_translated', $results['translation']); + if ($results) { + $row->setSourceProperty($other_property . '_translated', $results['translation']); + } + else { + // The translation does not exist. + $row->setSourceProperty($other_property . '_translated', NULL); + } parent::prepareRow($row); } diff --git a/core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php b/core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php index 34e4f93000..76be7154df 100644 --- a/core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php +++ b/core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php @@ -137,7 +137,7 @@ public function testLanguageBundleConditions() { // condition. $configuration = [ 'table' => 'node__field_tags', - 'left_table' => 'node', + 'left_table' => 'views_test_data', 'left_field' => 'nid', 'field' => 'entity_id', 'extra' => [ @@ -148,7 +148,7 @@ public function testLanguageBundleConditions() { ], ]; $join_info = $this->buildJoin($view, $configuration, 'node__field_tags'); - $this->assertContains('AND (node__field_tags.langcode = .langcode)', $join_info['condition']); + $this->assertContains('AND (node__field_tags.langcode = views_test_data.langcode)', $join_info['condition']); array_unshift($configuration['extra'], [ 'field' => 'deleted', @@ -156,7 +156,7 @@ public function testLanguageBundleConditions() { 'numeric' => TRUE, ]); $join_info = $this->buildJoin($view, $configuration, 'node__field_tags'); - $this->assertContains('AND (node__field_tags.langcode = .langcode)', $join_info['condition']); + $this->assertContains('AND (node__field_tags.langcode = views_test_data.langcode)', $join_info['condition']); // Replace the language condition with a bundle condition. $configuration['extra'][1] = [ @@ -173,7 +173,7 @@ public function testLanguageBundleConditions() { 'field' => 'langcode', ]; $join_info = $this->buildJoin($view, $configuration, 'node__field_tags'); - $this->assertContains('AND (node__field_tags.bundle = :views_join_condition_1 OR node__field_tags.langcode = .langcode)', $join_info['condition']); + $this->assertContains('AND (node__field_tags.bundle = :views_join_condition_1 OR node__field_tags.langcode = views_test_data.langcode)', $join_info['condition']); } /**