From 55a5187f79ed059c2a3b451579b98b7d6f47957c Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Mon, 15 Jul 2013 21:52:30 +1200 Subject: [PATCH] FIX: escape columns and tables for postgres --- code/model/UserDefinedForm.php | 4 ++-- tests/UserDefinedFormTest.php | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php index 6bdd01d..dad0431 100755 --- a/code/model/UserDefinedForm.php +++ b/code/model/UserDefinedForm.php @@ -130,8 +130,8 @@ class UserDefinedForm extends Page { // attach every column to the print view from $columns = SubmittedFormField::get() - ->where("SubmittedForm.ParentID = '$this->ID'") - ->leftJoin('SubmittedForm', 'SubmittedFormField.ParentID = SubmittedForm.ID') + ->where("\"SubmittedForm\".\"ParentID\" = '$this->ID'") + ->leftJoin('SubmittedForm', '"SubmittedFormField"."ParentID" = "SubmittedForm"."ID"') ->map('Name', 'Title'); $columns = $columns->toArray(); diff --git a/tests/UserDefinedFormTest.php b/tests/UserDefinedFormTest.php index 1fd3c20..ffc0310 100644 --- a/tests/UserDefinedFormTest.php +++ b/tests/UserDefinedFormTest.php @@ -38,9 +38,6 @@ class UserDefinedFormTest extends FunctionalTest { } function testGetCMSFields() { - // ensure all the tabs are present. - // @todo a common bug with this is translations messing up the tabs. - // @todo only logic we should check for is that the tablelistfield filter $this->logInWithPermission('ADMIN'); $form = $this->objFromFixture('UserDefinedForm', 'basic-form-page');