diff -u b/core/lib/Drupal/Core/Config/Schema/Sequence.php b/core/lib/Drupal/Core/Config/Schema/Sequence.php --- b/core/lib/Drupal/Core/Config/Schema/Sequence.php +++ b/core/lib/Drupal/Core/Config/Schema/Sequence.php @@ -33,9 +33,10 @@ * Gets the description of how the sequence should be sorted. * * @return string|null - * Describes how the sequence should be sorted. Either 'value', 'key' or - * NULL. NULL means that the schema does not describe how the sequence - * should be sorted. + * May be 'key' (to sort by key), 'value' (to sort by value, discarding + * keys), or NULL (if the schema does not describe how the sequence should + * be sorted). Only the top level of the array is sorted. Top-level keys are + * discarded when using 'value' sorting. */ public function getOrderBy() { $definition = $this->getDataDefinition(); diff -u b/core/lib/Drupal/Core/Config/Schema/SequenceDataDefinition.php b/core/lib/Drupal/Core/Config/Schema/SequenceDataDefinition.php --- b/core/lib/Drupal/Core/Config/Schema/SequenceDataDefinition.php +++ b/core/lib/Drupal/Core/Config/Schema/SequenceDataDefinition.php @@ -13,9 +13,10 @@ * Gets the description of how the sequence should be sorted. * * @return string|null - * Describes how the sequence should be sorted. Either 'value', 'key' or - * NULL. NULL means that the schema does not describe how the sequence - * should be sorted. + * May be 'key' (to sort by key), 'value' (to sort by value, discarding + * keys), or NULL (if the schema does not describe how the sequence should + * be sorted). Only the top level of the array is sorted. Top-level keys are + * discarded when using 'value' sorting. */ public function getOrderBy() { return isset($this->definition['orderby']) ? $this->definition['orderby'] : NULL; diff -u b/core/lib/Drupal/Core/Config/StorableConfigBase.php b/core/lib/Drupal/Core/Config/StorableConfigBase.php --- b/core/lib/Drupal/Core/Config/StorableConfigBase.php +++ b/core/lib/Drupal/Core/Config/StorableConfigBase.php @@ -218,9 +218,11 @@ case 'key': ksort($value); break; + case 'value': sort($value); break; + } } } diff -u b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php --- b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php @@ -396,7 +396,7 @@ } /** - * Test configuration sequence sorting using schemas. + * Tests configuration sequence sorting using schemas. */ public function testConfigSaveWithSequenceSorting() { $data = [