Presently, ctools_var_export iterates over a variable's sub-fields in appended order which can vary from system to system, depending on interactions with the calling module(s).

Since one of the ctools_var_export use-cases is integration with source control, sorting the keys will enhance the diffing process.

CommentFileSizeAuthor
#1 sort_ctools_var_export-1994856-2.patch716 bytesmmikitka

Comments

mmikitka’s picture

Status: Active » Needs review
StatusFileSize
new716 bytes

Attached is the patch file

mmikitka’s picture

Assigned: mmikitka » Unassigned
mmikitka’s picture

Any update on this?

mmikitka’s picture

Issue summary: View changes

Update?

mmikitka’s picture

Update?

szecsodimlaszlo’s picture

I can confirm that the patch from #1 is working.
Thank you.

mweiler2’s picture

Curious if there is an update on this ?

chris matthews’s picture

The 6 year old patch to export.inc applied cleanly to the latest ctools 7.x-1.x-dev, but may need an additional review & test before changing the status to RTBC.

szecsodimlaszlo’s picture

I can confirm that the patch from #1 is working with ctools 7.x-1.17 as well.
Thank you.

  • joelpittet committed d43257c on 7.x-1.x authored by mmikitka
    Issue #1994856 by mmikitka, szecsodimlaszlo, mweiler2, Chris Matthews:...
joelpittet’s picture

Status: Needs review » Fixed
Parent issue: » #3178697: Plan for CTools 7.x-1.18 release

I've committed this to dev, but without the conditional because we don't do that in other ksort() calls. Thanks for your contribution everyone!

Status: Fixed » Closed (fixed)

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

nick dewitte’s picture

This is causing a problem for us when exporting variables where the order of the values is significant.
Specifically, sorting the variables language_negotiation_language and language_negotiation_language_url breaks our language negotiation.

Is there any way to avoid this?