When exporting variables using Strongarm via Features, although Features reports that no variables have changed, when downloading the feature and performing a diff, the Features Strongarm .inc file can potentially report many changes, especially when multiple developers are contributing to the feature from many different databases. This is because the database call in the variable_features_export_render() function relies on the databases sorting of the records returned. Always ordering variables by name would make diffing much easier!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jantoine’s picture

Status: Active » Needs review
FileSize
736 bytes

Patch attached adding "ORDER BY name" to the query sting.

jantoine’s picture

I have com across this issue again and am curious as to the lack of feedback. Am I the only one experiencing this issue and if so, what am I doing wrong!

febbraro’s picture

Title: Stongarm's implementation of hook_features_export_render() relies on order of variables returned by the database. » Added explicit order to variables returned by the database in variable_features_export_render
Status: Needs review » Fixed

I have never seen the scenario you are talking about, but if I had to guess I would say you are using MyISAM tables which I think defaults to insertion order if not specified, whereas InnoDB tables default to PK ASC order.

I added the order anyway so that we are explicit, hope it helps.

http://drupalcode.org/project/strongarm.git/commit/a0771b2

febbraro’s picture

Version: 7.x-2.x-dev » 6.x-2.1
Status: Fixed » Patch (to be ported)
makara’s picture

Status: Patch (to be ported) » Needs review
FileSize
727 bytes

A simple port.

patricksettle’s picture

Status: Needs review » Closed (fixed)

Committed port - commit: e18eb9c

patricksettle’s picture

Status: Closed (fixed) » Fixed

setting to correct "fixed" status

Status: Fixed » Closed (fixed)

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