Commit 8739d3ab authored by TravisCarden's avatar TravisCarden

By TravisCarden: Sort saved progress elements alphabetically.

parent df0a9acf
......@@ -148,6 +148,7 @@ class ChecklistapiChecklist {
'#changed_by' => $user->uid,
'#completed_items' => 0,
);
// Loop through groups.
foreach ($values as $group_key => $group) {
// Loop through items.
......@@ -182,6 +183,12 @@ class ChecklistapiChecklist {
}
}
}
// Sort array elements alphabetically so changes to the order of tasks in
// checklist definitions over time don't affect the order of elements in the
// saved progress variable. This simplifies use with Strongarm.
ksort($progress);
variable_set($this->getSavedProgressVariableName(), $progress);
drupal_set_message(format_plural(
$changed_items_counter,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment