Skip to content
Snippets Groups Projects
Commit 37f5493f authored by Christina Petala's avatar Christina Petala Committed by Vasvi Sharma
Browse files

Upgrade Drupal to 10.4

parent 7f61acb0
No related branches found
No related tags found
1 merge request!276Upgrade Drupal to 10.4
......@@ -102,7 +102,7 @@
],
"require": {
"php": ">=8.1",
"bower-asset/bootstrap": "v5.3.3",
"twbs/bootstrap": "5.3.3",
"bower-asset/jquery-cycle": "3.0.3",
"bower-asset/jquery-hoverintent": "v1.10.2",
"bower-asset/json2": "dev-master",
......@@ -123,7 +123,7 @@
"drupal/cern-dev-status": "3.1.2",
"drupal/cern-display-formats": "3.0.1",
"drupal/cern-full-html-format": "3.0.2",
"drupal/cern-indico-feeds": "3.0.2",
"drupal/cern-indico-feeds": "3.0.4",
"drupal/cern-install-profiles": "9.0.2",
"drupal/cern-integration": "2.0.0",
"drupal/cern-landing-page": "3.0.4",
......@@ -145,10 +145,11 @@
"drupal/components": "3.1.0",
"drupal/config_update": "2.0.0-alpha4",
"drupal/content_access": "2.0.0",
"drupal/core-composer-scaffold": "10.3.10",
"drupal/core-project-message": "10.3.10",
"drupal/core-recommended": "10.3.10",
"drupal/core-composer-scaffold": "10.4.3",
"drupal/core-project-message": "10.4.3",
"drupal/core-recommended": "10.4.3",
"drupal/ctools": "4.1.0",
"drupal/date_filter": "1.0.2",
"drupal/date_popup": "2.0.2",
"drupal/devel": "5.3.1",
"drupal/ds": "3.24.0",
......@@ -307,10 +308,12 @@
"Fixes crash if an external URL is specified in page path https://www.drupal.org/project/drupal/issues/2973422": "patches/save_views_external_url-2973422-19.patch",
"Fixes call to a member function getAccountName() on null https://www.drupal.org/project/drupal/issues/3161212": "patches/core-node_add_author_error-3161212-2-9.x.patch",
"Fixes TypeError: Cannot access offset of type string on string https://www.drupal.org/project/drupal/issues/3336312": "patches/3336312.patch",
"Fixes Rewrite as URL adding equals sign to end of url https://www.drupal.org/project/drupal/issues/1464244#comment-15685744":"patches/1464244-71.patch",
"Fixes Rewrite as URL adding equals sign to end of url https://www.drupal.org/project/drupal/issues/1464244#comment-15685744": "patches/1464244-71.patch",
"Fixes markup issue https://www.drupal.org/project/drupal/issues/3253568": "patches/3253568-18.patch",
"Fixes RssFields compatibility issue https://www.drupal.org/project/drupal/issues/2511878#comment-15806953": "patches/2511878-85-10.3.patch",
"Fixes Argument #2 must be of type array, null given in array_diff() https://www.drupal.org/project/drupal/issues/3460773": "patches/ThemeRegistry.patch"
"Fixes Argument #2 must be of type array, null given in array_diff() https://www.drupal.org/project/drupal/issues/3460773": "patches/ThemeRegistry.patch",
"Grouped exposed filters do not work when input from user is an array https://www.drupal.org/project/drupal/issues/3357973": "patches/core-1810148_114-1.patch",
"Invalid config structure can result in exceptions when saving a config entity https://www.drupal.org/project/drupal/issues/2925890": "patches/2925890-75.patch"
},
"drupal/paragraphs": {
"Fixes data loss on using the Paragraphs Asymmetric Translation Widgets https://www.drupal.org/project/paragraphs_asymmetric_translation_widgets/issues/2992777": "patches/patch-to-fix-wrong-summary-on-converted-async-paragraphs-after-running-patch-2992777-v2.patch"
......@@ -322,7 +325,7 @@
"Fixes call to a member function isEmpty() on null https://www.drupal.org/project/filefield_paths/issues/3339688": "patches/filefield_paths-call_isEmpty_on_null-3339688-4.patch"
},
"drupal/filelog": {
"Fixes Circular reference detected for service https://www.drupal.org/project/filelog/issues/3416342":"patches/3416342-12.patch"
"Fixes Circular reference detected for service https://www.drupal.org/project/filelog/issues/3416342": "patches/3416342-12.patch"
},
"__comments__": {}
},
......@@ -339,4 +342,4 @@
"merge-scripts": true
}
}
}
\ No newline at end of file
}
diff --git a/core/lib/Drupal/Core/Config/Config.php b/core/lib/Drupal/Core/Config/Config.php
index 447bed82fb..edff99d4ea 100644
--- a/core/lib/Drupal/Core/Config/Config.php
+++ b/core/lib/Drupal/Core/Config/Config.php
@@ -204,18 +204,26 @@ public function save($has_trusted_data = FALSE) {
// If there is a schema for this configuration object, cast all values to
// conform to the schema.
- if (!$has_trusted_data) {
- if ($this->typedConfigManager->hasConfigSchema($this->name)) {
- // Ensure that the schema wrapper has the latest data.
- $this->schemaWrapper = NULL;
- $this->data = $this->castValue(NULL, $this->data);
- }
- else {
- foreach ($this->data as $key => $value) {
- $this->validateValue($key, $value);
+ try {
+ if (!$has_trusted_data) {
+ if ($this->typedConfigManager->hasConfigSchema($this->name)) {
+ // Ensure that the schema wrapper has the latest data.
+ $this->schemaWrapper = NULL;
+ foreach ($this->data as $key => $value) {
+ $this->data[$key] = $this->castValue($key, $value);
+ }
+ }
+ else {
+ foreach ($this->data as $key => $value) {
+ $this->validateValue($key, $value);
+ }
}
}
}
+ catch (\Exception $e) {
+ // Log and ignore exceptions caused by invalid config structures.
+ watchdog_exception('config', $e);
+ }
// Potentially configuration schema could have changed the underlying data's
// types.
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php
index c337f574d6..a4863f93b7 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php
@@ -9,7 +9,6 @@
use Drupal\Core\Config\ConfigNameException;
use Drupal\Core\Config\ConfigValueException;
use Drupal\Core\Config\DatabaseStorage;
-use Drupal\Core\Config\UnsupportedDataTypeConfigException;
use Drupal\KernelTests\KernelTestBase;
/**
@@ -264,7 +263,7 @@ public function testValueValidation(): void {
* Tests data type handling.
*/
public function testDataTypes(): void {
- \Drupal::service('module_installer')->install(['config_test']);
+ \Drupal::service('module_installer')->install(['config_test', 'dblog']);
$storage = new DatabaseStorage($this->container->get('database'), 'config');
$name = 'config_test.types';
$config = $this->config($name);
@@ -327,28 +326,26 @@ public function testDataTypes(): void {
// Test that setting an unsupported type for a config object with a schema
// fails.
- try {
- $config->set('stream', fopen(__FILE__, 'r'))->save();
- $this->fail('No Exception thrown upon saving invalid data type.');
- }
- catch (UnsupportedDataTypeConfigException $e) {
- // Expected exception; just continue testing.
- }
+ // does not throw an exception but logs an error.
+ $config->set('stream', fopen(__FILE__, 'r'))->save();
+ $last_watchdog = \Drupal::database()->query('SELECT * FROM {watchdog} ORDER BY wid DESC')->fetchAssoc();
+ $variables = unserialize($last_watchdog['variables']);
+ $this->assertEquals('Invalid data type for config element config_test.types:stream', $variables['@message']);
+ $this->assertEquals('Drupal\Core\Config\UnsupportedDataTypeConfigException', $variables['%type']);
// Test that setting an unsupported type for a config object with no schema
// also fails.
+ // also logs an error.
$typed_config_manager = $this->container->get('config.typed');
$config_name = 'config_test.no_schema';
$config = $this->config($config_name);
$this->assertFalse($typed_config_manager->hasConfigSchema($config_name));
- try {
- $config->set('stream', fopen(__FILE__, 'r'))->save();
- $this->fail('No Exception thrown upon saving invalid data type.');
- }
- catch (UnsupportedDataTypeConfigException $e) {
- // Expected exception; just continue testing.
- }
+ $config->set('stream', fopen(__FILE__, 'r'))->save();
+ $last_watchdog = \Drupal::database()->query('SELECT * FROM {watchdog} ORDER BY wid DESC')->fetchAssoc();
+ $variables = unserialize($last_watchdog['variables']);
+ $this->assertEquals('Invalid data type for config element config_test.no_schema:stream', $variables['@message']);
+ $this->assertEquals('Drupal\Core\Config\UnsupportedDataTypeConfigException', $variables['%type']);
}
}
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
index 6c0fcf5d42..265742906e 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
@@ -482,8 +482,8 @@ public function testConfigSaveWithSchema(): void {
public function testConfigSaveMappingSort(): void {
// Top level map sorting.
$data = [
- 'foo' => '1',
'bar' => '2',
+ 'foo' => '1',
];
// Save config which has a schema that enforces types.
$this->config('config_schema_test.schema_mapping_sort')
\ No newline at end of file
diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
index 76c9635559..74541853e8 100644
--- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
@@ -350,9 +350,24 @@ public function validateExposed(&$form, FormStateInterface $form_state) {
$identifier = $this->options['expose']['identifier'];
$input = $form_state->getValue($identifier);
- if ($this->options['is_grouped'] && isset($this->options['group_info']['group_items'][$input])) {
- $this->validated_exposed_input = $this->options['group_info']['group_items'][$input]['value'];
- return;
+ if ($this->options['is_grouped']) {
+ if (is_array($input)) {
+ $filtered_inputs = array_filter($input);
+ if ($filtered_inputs) {
+ $values = [];
+ foreach ($filtered_inputs as $filtered_input) {
+ $values += $this->options['group_info']['group_items'][$filtered_input]['value'];
+ }
+ $this->validated_exposed_input = $values;
+ return;
+ }
+ }
+ else {
+ if (isset($this->options['group_info']['group_items'][$input])) {
+ $this->validated_exposed_input = $this->options['group_info']['group_items'][$input]['value'];
+ return;
+ }
+ }
}
// We only validate if they've chosen the text field style.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment