Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The docs recommend to use <code>saveAssociated</code> or <code>saveMany</code> depending on the case</p> <blockquote> <p>This function receives the same options as the former two, and is generally a backwards compatible function. It is recommended using either saveMany or saveAssociated depending on the case</p> </blockquote> <p>So the first choice is to change that <code>saveAll</code> to <code>saveAssociated</code>, since I think there's just <em>one</em> user and <em>one</em> profile.</p> <p>All <a href="http://api.cakephp.org/2.0/source-class-Model.html#1868-1909" rel="nofollow">saveAll</a> does is to call <code>Set::numeric(array_keys($data))</code>, and if that is <code>true,</code> calls <code>saveMany</code>, otherwise <code>saveAssociated</code>. The problem probably is in that <code>Set::numeric</code> comparison. If you want to get to the bottom of that, do a debug of </p> <pre><code>Set::numeric(array_keys($this-&gt;request-&gt;data)); </code></pre> <p>If that gives you <code>true</code>, it must consider your array to be numerically indexed. Then you'll need to start debugging why is considered that way, check the <a href="http://api.cakephp.org/2.0/source-class-Set.html#204-231" rel="nofollow">Set::numeric</a> function, where does the bad check, and change it or report it as a bug.</p> <p>I think that trying to debug that is more troublesome than to change <code>saveAll</code> to <code>saveAssociated</code>, though, since you commented that the last gives you no problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload