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.

Archive /

Our old forums are still available as a read-only archive.

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

Form Error - Trying to get property of non-object


Go to End


3 Posts   1514 Views

Avatar
Josh

SilverStripe Developer, 65 Posts

18 June 2008 at 11:36am

Just trying to code up a form that returns a users details from the database. Keep getting the following error when trying to run the linked code:

Trying to get property of non-object in /Applications/MAMP/localhost/silverstripe/mysite/code/UserInfoPage.php on line 33

Code
http://pastebin.com/m249278a

Pointers greatly appreciated!

Avatar
Willr

Forum Moderator, 5523 Posts

18 June 2008 at 6:25pm

I dont think that will work. If Im correct you have a email field and on submit you want to get the users details? $this->Form-Email wont work but you could try

   function GetUserDetails($data, $form) {
         $email = $data['Email'];
         // do crazy stuff
         return;
   }

Avatar
Josh

SilverStripe Developer, 65 Posts

18 June 2008 at 7:11pm

Thank You!