When writing to datastore in one site, the order of the keys in the array can change which create fake "Overridden" elements.
--- a/sites/datastore/backends/field.node.body.public_page.inc
+++ b/sites/datastore/backends/field.node.body.public_page.inc
@@ -113,11 +113,11 @@ $data = array(
),
'required' => FALSE,
'description' => '',
- 'default_value' => NULL,
'field_name' => 'body',
'entity_type' => 'node',
'bundle' => 'public_page',
'deleted' => '0',
+ 'default_value' => NULL,
),
);

The solution is to add ksort when exporting.
I used this method in other places as well to have full consistency.
-------
Bernard Szlachta
http://www.nobleprog.co.uk/drupal/training
http://www.nobleprog.us/drupal-training-courses

Comments

ar-jan’s picture

I have the same thing happening with permissions - the order of roles is different. This actually happened on just one site: start tracking, revisit the tracking tab, and one of the permissions being tracked is shown as overridden.

rylowry@gmail.com’s picture

StatusFileSize
new40.72 KB
new83.79 KB

I'm also having this problem. When I was learning about this module, I followed a video (http://sydney2013.drupal.org/configuration-management-drupal-7), which if I recall correctly, describes the usefulness of being able to check your .inc files into revision control, and deploy them elsewhere by doing a pull, and then syncing them to the active store. Here is how things have been going for me:

  • Export configuration from site A.
  • Check in files to version control.
  • Go to site B, pull new .inc files.
  • Press "Synchronize configurations," which ends up calling ConfigurationManagement::importToActiveStore($to_track, FALSE, FALSE, TRUE). That last TRUE will cause the configurations to be re-exported to .inc files.
  • Now a bunch of your .inc files are out of sync with revision control because fields have been reordered.

It seems to me that in an ideal world, you would pull, sync new configs to the active store, start tracking, and if everything went successfully, the .inc file *would not change*.

In the case I describe above, my import is basically successful. All the meaningful configurations are inserted into the database, and the site works fine. But since there are changes to the .inc file, there is a chance future pulls will fail. What if there is a conflicting change? Just to further illustrate the problem, here are some diffs showing changes that occur to the .inc files.

Some fields being juggled around:
Field Diff

Foreign key table mysteriously moves:
Table Diff

rylowry@gmail.com’s picture

StatusFileSize
new1.17 KB

Here's a little patch that does a ksort in StoragePhp::export(), and a sort in PermissionConfiguration::prepareBuild(). The ksort prevents reordering in the optional and dependency lists, and the sort in PermissionConfiguration keeps roles in the same order inside exported permissions.

chi’s picture

Status: Active » Needs review
chi’s picture

Status: Needs review » Reviewed & tested by the community

Works for me

bnobleman’s picture

works for me as well

bnobleman’s picture

Issue summary: View changes

added signature

dagmar’s picture

3: sort_exports-1958464-3.patch queued for re-testing.

dagmar’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Committed and Pushed to 7.x-2.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.