Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm having an issue with a feature that is sometimes overridden and sometimes not. It varies from machine from machine and even on individual machines. I found that one of the exported fields (of type commentfield) was using a mix of numeric and string keys in the instance settings. ksort()
doesn't exactly like this and results in inconsistent results. Using a natural sort would guarantee consistent results from the sort each time.
Comment | File | Size | Author |
---|---|---|---|
#3 | features-field-export-natural-sort-1866954-3.patch | 402 bytes | mpotter |
#1 | features-field-export-natural-sort-1866954-1.patch | 393 bytes | BassistJimmyJam |
Comments
Comment #1
BassistJimmyJam CreditAttribution: BassistJimmyJam commentedPatch attached. Unfortunately, the flag
SORT_NATURAL
was not added until PHP 5.4 so I had to be a bit more creative.Comment #2
logaritmisk CreditAttribution: logaritmisk commentedI have this patch on a features heavy site in production and everything is working fine.
Comment #3
mpotter CreditAttribution: mpotter commentedTrying to get this to pass the testbot.
Comment #4
mpotter CreditAttribution: mpotter commentedCommitted to 425d04c. Need to keep an eye on any features Overridden caused by this patch.