Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

User Defined Forms, possible bug?


Go to End


7 Posts   3290 Views

Avatar
Junglefish

Community Member, 109 Posts

5 August 2009 at 12:06am

Hi

Am using User Defined Forms module 0.2.0, over SilverStripe build 2.3.3.

I set up a form with a couple of selectboxes and some checkboxes. No problem. The form submits fine and the submitted entries turn up on the Submissions tab.

However, when trying to set up an email recipient on the Email Recipients tab, as soon as I hit Add, I get the following error:

Fatal error: Call to a member function toDropdownMap() on a non-object in D:\wamp\www\SilverStripe\userforms\code\UserDefinedForm.php on line 605

Anyone know what this is?

Avatar
Junglefish

Community Member, 109 Posts

6 August 2009 at 7:52pm

^^Wondering...^^

...did I post this to the wrong part of the forum? 28 views and no replies yet. :-)

I've found references to the same error, ie. "Call to a member function toDropdownMap() on a non-object..." elsewhere in the forums, but never in connection with UserDefinedForm.php - it's always some other module or one of the core modules.

I'm still searching for a solution, and am wondering if I should just re-install the module, but all advice still much appreciated.

Thanks,

Avatar
Willr

Forum Moderator, 5523 Posts

6 August 2009 at 8:28pm

Quick fix Open up UserDefinedForm.php and find this on line 605

$multiOptionFields = $multiOptionFields->toDropdownMap('ID', 'Title');
$fields->insertAfter(new DropdownField('SendEmailToFieldID....

and just add a if round it

if(is_object($multiOptionFields)) {
$multiOptionFields = $multiOptionFields->toDropdownMap('ID', 'Title');
$fields->insertAfter(new DropdownField('SendEmailToFieldID....
}

Will get a patch into the module asap.

Avatar
Junglefish

Community Member, 109 Posts

6 August 2009 at 9:57pm

Thanks willr, much appreciated.

Avatar
dany_doo

Community Member, 13 Posts

15 September 2009 at 9:59pm

I had the same problem.. Thx.

Avatar
house98

Community Member, 31 Posts

18 November 2009 at 1:58am

Thanks! Had the same problem, this fixed it right up :)

Avatar
Doverose

Community Member, 8 Posts

21 January 2010 at 9:01am

Thanks a million.