-1

I've just had a v1.3 site upgraded to v3 and it's buggy as all hell, the developer is away for the weekend and I'm trying to get things fixed.

So in both my v1.3 site and my v2 site I'm able to have an array declared against a model eg My Person model might have

$salutation = array('Dr', 'Mr', Ms');

Then if my Order controller was creating a form and capturing a new user's details I could call

$this->set('salutation', $this->Order->Person->salutation);

and my view would have the right list for the form. It worked like a treat and I used that technique widely.

HOWEVER that doesn't seem to be the way to do things in v3 so I've created a behavior called Listsbehavior and I've created a test example where I have my default list set up and I call it but I get an error

Error: Call to a member function setSalutation() on boolean 

Any hints on how to unravel my old school strategies and get the new ones working?

Sarah K
  • 363
  • 2
  • 15
  • I don't see why declaring and accessing a property wouldn't work anymore... you may want to provide a little more context, especially with regards to the form. The "_call to a member function ... on boolean_" error means that the property that you're accessing, respectively the class that you're trying to load isn't accessible: **https://stackoverflow.com/questions/31813722/what-means-call-to-a-member-function-on-boolean-and-how-to-fix**. For more specific help there'd be again more context required. – ndm Jul 23 '17 at 14:18
  • You need to show your current trying-to-make-it-work code and the relevant error, with stacktrace. Stating that you had a 1.3 app that worked, and after upgrading you get `Call to a member function setSalutation() on boolean` only indicates that it now doesn't work - but doesn't give much information at all to help readers to point out what to do about it. `$this->Order->Person` is probably `false` because `$this->Order` is not an instance of the class you expect. -1. – AD7six Jul 30 '17 at 17:06
  • Apparently all I needed to do was make the model names plural! – Sarah K Jul 30 '17 at 21:10

1 Answers1

0

Model names are now plural rather than singular. I'm sure I'll work out why at some stage but all I needed to do was add an "s" to the calls.

Sarah K
  • 363
  • 2
  • 15