Steps to reproduce
1) Create a field if type list (text).
2) Enter for allowed values 'bam|Bam', 'arf|Arf'
3) Export

The allowed_values will now be Arf, Bam instead of Bam, Arf

Possible other situations where re-ordering is really not desired.

Comments

seanberto’s picture

Subscribe. Also, wondering if this is actually a ctools issue.

hefox’s picture

I don't believe ctools is being used to handle fields -- it's not in 6 and doesn't look like it's changed for 7.

fearlsgroove’s picture

Status: Active » Needs review
StatusFileSize
new502 bytes

Attached patch excludes "allowed_values" from the sort that's applied to field export arrays.

hefox’s picture

Looks good and seems to function correctly.; only problem would be if another setting had a sub element that happen to have an allowed values key, but that seems like a low probability.

(Though, thinking it, may later need a hook so modules could tell features not to re-order some of their items (based on something hierarchical?, but shrug.)

tunic’s picture

StatusFileSize
new837 bytes

Same problem here, and I swear I have not little number of option to resort :D

#3 patch looks good but as hefox says may problems if there're subelements. That's not the case for the allowed_values element AFAIK. Anyway I've roll a patch that avoids sorting but process child elements (if any). An array with the blacklisted values is included, so it's easy to add array keys that must not be sorted (but its child might).

febbraro’s picture

Status: Needs review » Patch (to be ported)

Patch in #5 committed to 7.x branch http://drupalcode.org/project/features.git/commit/255b021

Id this also needed for D6?

hefox’s picture

Assigned: Unassigned » hefox

I've never seen it happen with 6.x, but I'll look into it to see if there's a possibility. thanks

hefox’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Assigned: hefox » Unassigned

  • febbraro committed 255b021 on 8.x-3.x
    Issue #1186694 by tunic, fearlsgroove: Features orders exportes...