Error:
[User Error] Couldn't run query: SELECT DISTINCT "SiteTree_Live"."ClassName", "SiteTree_Live"."Created", "SiteTree_Live"."LastEdited", "SiteTree_Live"."UserDefinedForm_Live", "UserDefinedForm_Live"."SubmitButtonText", "UserDefinedForm_Live"."OnCompleteMessage", "UserDefinedForm_Live"."ShowClearButton", "UserDefinedForm_Live"."DisableSaveSubmissions", "UserDefinedForm_Live"."EnableLiveValidation", "UserDefinedForm_Live"."HideFieldLabels", "SiteTree_Live"."ID", CASE WHEN "SiteTree_Live"."ClassName" IS NOT NULL THEN "SiteTree_Live"."ClassName" ELSE 'SiteTree' END AS "RecordClassName", "SiteTree_Live"."Sort" FROM "SiteTree_Live" LEFT JOIN "UserDefinedForm_Live" ON "UserDefinedForm_Live"."ID" = "SiteTree_Live"."ID" WHERE ("UserDefinedForm_Live"."ID" = 9) AND ("SiteTree_Live"."ClassName" IN ('UserDefinedForm')) ORDER BY "SiteTree_Live"."Sort" ASC LIMIT 1 Unknown column 'SiteTree_Live.UserDefinedForm_Live' in 'field list'
PHP:
public function ShowFeedback()
{
//Hard coded ID for testing purposes
return new UserDefinedForm_Controller(SiteTree::get()->byID(9));
}
Template:
<% loop ShowFeedback %>
$Form
<% end_loop %>
Question:
I've written a very small and dirty module that lets the user choose which page to show a created userform on via the CMS. Everything works as expected, and if they attach an empty userform (no form fields created, only the page type created) everything works. As soon as a form field is added to the userform, the following error is shown on the page (not in the CMS).
The strange thing is the form still displays on the page as expected, and even submits.
So what am I doing wrong that is creating this error?
Unknown column 'SiteTree_Live.UserDefinedForm_Live' in 'field list'
Would love some insight to how I should resolve this issue.