BUGFIX: IN clause was not being picked up, failing in MSSQL and not giving proper results on MySQL (OS ticket 6072)

This commit is contained in:
Mateusz Uzdowski 2010-10-08 00:29:18 +00:00
parent 8d3cb472dc
commit a2e998ab79
2 changed files with 3 additions and 2 deletions

View File

@ -96,7 +96,8 @@ class SubmittedFormReportField extends FormField {
$csvHeaders = DB::query("SELECT DISTINCT \"Name\" , \"Title\" FROM
((
SELECT \"Name\" , \"Title\" FROM \"SubmittedFormField\"
LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ")
LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\"
WHERE \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ")
ORDER BY \"SubmittedFormField\".\"ParentID\" DESC, \"SubmittedFormField\".\"ID\"
) AS \"tmp\")");
if ($csvHeaders) $csvHeaders = $csvHeaders->map();

View File

@ -63,7 +63,7 @@ class SubmittedFormTest extends FunctionalTest {
// check the headers are fine and include every legacy field. They should also be ordered
// according to the latest form layout.
$this->assertEquals($data[0], array(
'First', 'Submitted Title 2', 'Submitted Title', 'Field 2', 'Field 1', 'File', 'Submitted'
'First', 'Submitted Title 2', 'Submitted Title', 'Submitted'
));
// check the number of records in the export