10389 Posts in 2200 Topics by 1712 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 709 Views |
-
Extending Userforms

31 July 2011 at 10:52am
Hi,
I'm using the userforms module, but I want to extend it to make a 'survey' page type.
I made a file 'SurveyPage.php' in my code folder with
class SurveyPage extends UserDefinedForm { } and
class SurveyPage_Controller extends UserDefinedForm_Controller { }I'm adding a few extra bits of data to these pages - such as terms, owener, a logo etc. This all works fine, and I can add the extra into to the CMS.
However, when I 'save and publish' in the CMS, I'm just getting an error message.
I'm also trying to make it new page type, so I can make template 'SurveyPage.ss' which I can use to style all the surveys.
Any help appreciated
-
Re: Extending Userforms

31 July 2011 at 11:17am
Please post (a brief version of) the error message. Without that, it's all guessing.
If you didn't already, install Firebug. You should be able to pull more information from the NET or Console.
-
Re: Extending Userforms

31 July 2011 at 12:05pm
Hi, the error that the CMS gives back is 'Error saving content' -> this is displayed to the right of the 'save and publish' button
using firebug 'net' tab, I can see there is a '500 Internal Server Error' on the post request to /admin/EditForm/
I've set SS_Log::add_writer(new SS_LogEmailWriter('myemail'), SS_Log::ERR), and this emailing with a report saying:
"At line 65 in /home/mydomain/sapphire/forms/HtmlEditorField.php"
-
Re: Extending Userforms

31 July 2011 at 12:08pm
Solved!
Ok, having worked through all that,
i figured it was because I had:
public static $db = array(
'Terms'=> 'Text'
);and then:
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Terms', new HTMLEditorField('Terms', 'Terms and Conditions'));
return $fields;
}the fact I was making a HMTL text area in the CMS, and trying to save into a TXT database field was the problem!
so I just had to change topublic static $db = array(
'Terms'=> 'HTMLText'
);
| 709 Views | ||
|
Page:
1
|
Go to Top |


