Add orderby key to third party settings

Created on 14 March 2017, almost 8 years ago
Updated 31 December 2023, about 1 year ago

Follow-up to 📌 Add orderby key to all sequences in core Active

Problem/Motivation

Sequences that are not sorted can result in unexpected configuration differences whilst importing configuration. Which confuses users because they are being told something is different when it is not. Also this behaviour can result in random test fails

Third party settings are ordered by the order in which the third party settings are added. This means that the same configuration can be different on depending on the order in which it is was configured.

Proposed resolution

Add orderby key and test it.

Remaining tasks

User interface changes

None

API changes

None.

Data model changes

All sequences in configuration sorted. This patch will introduce the generic upgrade path for all 📌 Add orderby key to all sequences in core Active sub-issues.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Configuration 

Last updated about 17 hours ago

Created by

🇬🇧United Kingdom alexpott 🇪🇺🌍

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • First commit to issue fork.
  • @rpayanm opened merge request.
  • Status changed to Needs review almost 2 years ago
  • 🇺🇸United States rpayanm

    Reeolled.

  • Status changed to Needs work almost 2 years ago
  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

    moving to NW for change record.

  • Status changed to RTBC about 1 year ago
  • 🇧🇪Belgium borisson_ Mechelen, 🇧🇪

    Added a CR. Back to rtbc.

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Patch Failed to Apply
  • Status changed to Needs work about 1 year ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍
    +++ b/core/modules/system/system.post_update.php
    @@ -51,3 +51,30 @@ function system_post_update_linkset_settings() {
    +    // Resave configuration to ensure any new sorting is applied.
    +    $config_factory->getEditable($config_name)->save();
    

    During updates you need to save with trusted data set to TRUE otherwise you can get in the way of other updates. Therefore you need to do sort here. Also you should only same them if they have third party settings.

  • Status changed to Needs review about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MariaDB 10.3.22
    last update about 1 year ago
    30,487 pass
  • Status changed to RTBC about 1 year ago
  • 🇺🇸United States smustgrave

    @ameymudras thanks for working on this. Please include interdiffs though to easily see the changes.

    + $config_factory->getEditable($config_name)->save(TRUE);
    Seems to address #35

    Since this was previously RTBC going to restore but do wonder about

    unset($sandbox['config_names'][$key]);

  • Status changed to Needs work about 1 year ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍
    +++ b/core/modules/system/system.post_update.php
    @@ -58,6 +58,35 @@ function system_post_update_linkset_settings() {
    +      $config_factory->getEditable($config_name)->save(TRUE);
    

    Trusting the configuration here means that it will not sort. So this update function will not work. See discussions on 🐛 Consistently sort filter formats to simplify config exports Fixed for lots about this.

    I think here we should change the update to do the sorting and continue to use the trusted data feature as this update should not be fixing other things.

    We also need to add a sort to \Drupal\Core\Config\Entity\ConfigEntityBase::preSave() in the same place as we do the dependency sorting.

  • Status changed to Needs work about 1 year ago
  • 🇧🇪Belgium borisson_ Mechelen, 🇧🇪

    Removing the needs CR tag,

Production build 0.71.5 2024