Hey janulka did you ever get this sorted? I'm having exactly the same problem as Janulka above - anyone have any ideas?
Thanks,
Neil
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
- Previous 10 entries
- 1
- Page 22(current)
Ok I got this working... The problem was using 'getForm' as the name of the function - it was causing a conflict somewhere. When I changed the title to something else it worked for me.
eg. my function looks like this
public function CVForm() {
$record = DataObject::get_one("UserDefinedForm", "URLSegment = 'submit-your-cv'");
$results = new UserDefinedForm_Controller($record);
return $results;
}
i wrote a little tutorial that might help with this one:
http://www.clickheredigital.co.uk/blog/how-to-include-a-silverstripe-form-on-any-every-page/
Hi all,
I had this working with the earlier bullds of UDF. However, with the version [v0.5.0] build, I receive the following error:
Fatal error: Call to a member function getVar() on a non-object in /html/userforms/code/model/UserDefinedForm.php on line 406
My function is similar as the link above and this post
function ShowForm1(){
$get = DataObject::get_one("UserDefinedForm");
return new UserDefinedForm_Controller($get);
}
what member data are you trying to collect?
looks like when the form is submitted the function is failing to get the member. Do you have an IF function for when there is no member?
The original form was created with UDF. It works normally if I call the page directly. However, if I try to use the 'ShowForm()' function and the template $Form, I get the issue mentioned.
Well, looks like a bug in UDF .5,line 406 - userdefinedform.php
I have resolved it by put a 'if' clause around the following line
to
//$request = $this->getRequest();
// set the values passed by the url to the field
if ($request = $this->getRequest()) {
if($var = $request->getVar($field->name)) {
$field->value = Convert::raw2att($var);
}
}
$fields->push($field);
}
If you're getting the white screen of death with this, check what JS the UserDefinedForm is including.... it may just be a JS conflict
- Previous 10 entries
- 1
- Page 22(current)