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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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   1428 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!