mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
BUGFIX: ORDER BY in nested query does not work under MSSQL, remove
This commit is contained in:
parent
a2e998ab79
commit
cec87a859e
@ -93,13 +93,11 @@ class SubmittedFormReportField extends FormField {
|
|||||||
foreach($submissions as $submission) {
|
foreach($submissions as $submission) {
|
||||||
$inClause[] = $submission->ID;
|
$inClause[] = $submission->ID;
|
||||||
}
|
}
|
||||||
$csvHeaders = DB::query("SELECT DISTINCT \"Name\" , \"Title\" FROM
|
$csvHeaders = DB::query("SELECT \"Name\" , \"Title\" FROM \"SubmittedFormField\"
|
||||||
((
|
LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\"
|
||||||
SELECT \"Name\" , \"Title\" FROM \"SubmittedFormField\"
|
WHERE \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ")
|
||||||
LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\"
|
ORDER BY \"SubmittedFormField\".\"ParentID\" DESC, \"SubmittedFormField\".\"ID\"
|
||||||
WHERE \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ")
|
");
|
||||||
ORDER BY \"SubmittedFormField\".\"ParentID\" DESC, \"SubmittedFormField\".\"ID\"
|
|
||||||
) AS \"tmp\")");
|
|
||||||
if ($csvHeaders) $csvHeaders = $csvHeaders->map();
|
if ($csvHeaders) $csvHeaders = $csvHeaders->map();
|
||||||
|
|
||||||
if($submissions && $submissions->exists()) {
|
if($submissions && $submissions->exists()) {
|
||||||
|
@ -69,6 +69,10 @@ class SubmittedFormTest extends FunctionalTest {
|
|||||||
// check the number of records in the export
|
// check the number of records in the export
|
||||||
$this->assertEquals(count($data), 12);
|
$this->assertEquals(count($data), 12);
|
||||||
|
|
||||||
|
$this->assertEquals(count($data[1]), 4);
|
||||||
|
$this->assertEquals(count($data[2]), 4);
|
||||||
|
$this->assertEquals(count($data[11]), 4);
|
||||||
|
|
||||||
$this->assertEquals($data[1][1], 'quote " and comma , test');
|
$this->assertEquals($data[1][1], 'quote " and comma , test');
|
||||||
$this->assertEquals($data[1][2], 'Value 1');
|
$this->assertEquals($data[1][2], 'Value 1');
|
||||||
$this->assertEquals($data[2][1], 'Value 2');
|
$this->assertEquals($data[2][1], 'Value 2');
|
||||||
|
Loading…
Reference in New Issue
Block a user