Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Warning: Attempt to assign property of non-object 13 Jun 2016 12:55 #14046

Hi Cooks,

I'm getting the "Warning: Attempt to assign property of non-object in" warning when I try and assign values to the $data in my model fork.

Does anyone have any clues?

I'm editing a fork to modify the function loadFormData() to setup some (complex) default values. (Complex meaning I'm looking up tables, applying logic, concatenate strings, etc).

It happens on a line like this...
$data->branch_id = 1;

Prior to that line I have the usual...
$data = parent::loadFormData();
... plus other usual code...
Just call me Chris :)

Please Log in or Create an account to join the conversation.

Last edit: by organicwebs. Reason: making easier to read

Warning: Attempt to assign property of non-object 13 Jun 2016 13:09 #14047

For other who may need to know, I found the problem.

$data was being returned as an array from the Parent . So to fix I used...
$data['branch_id'] = 1;
Instead of
$data->branch_id = 1;
Just call me Chris :)

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.099 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started