BUGFIX: Submissions were exported in implied ID order, which is not guaranteed on all DB engines, esp postgres, so put in explicit order

This commit is contained in:
Mark Stephens 2010-09-20 03:54:52 +00:00
parent 3bb82d43f6
commit 40592031ff

View File

@ -86,7 +86,7 @@ class SubmittedFormReportField extends FormField {
$csvHeaderNames = array(); $csvHeaderNames = array();
$csvHeaderTitle = array(); $csvHeaderTitle = array();
$submissions = $udf->Submissions(); $submissions = $udf->Submissions("", "\"ID\"");
if($submissions && $submissions->exists()) { if($submissions && $submissions->exists()) {
@ -103,7 +103,7 @@ class SubmittedFormReportField extends FormField {
FROM \"SubmittedFormField\" FROM \"SubmittedFormField\"
LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\" LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\"
WHERE \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ") WHERE \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ")
GROUP BY \"Name\" GROUP BY \"SubmittedFormField\".\"ID\",\"Name\",\"Title\"
ORDER BY \"SubmittedFormField\".\"ID\" ORDER BY \"SubmittedFormField\".\"ID\"
"); ");