Hi,
I'm having trouble with save() and was wondering if anyone could shed
some light on the problem. I inherited a project that has a page with
a form on it which updates information to a database upon submission.
It uses the save() method to update the data in the table, and it
works fine for all the fields that were on the form when I started
working on it. Now I'm trying to add a few new fields on the form and
in the database, but save() refuses to save my data. It still saves
every *other* field, just not my new ones. The line that saves the
data is simply:
$this->Modelname->save($this->data, false);
I've print_r()'d $this->data, and the field names are in there just
fine. They exist in the database. There is no fields list in the call
to save() as you can see, and I tried turning validation off. I just
can't get it to work and it's rather frustrating.
I went into model_php5.php, and print_r()'d out $fields and $values
above this line:
if ($db->update($this, $fields, $values)) {
and my new fields are not in there. So I printed out the result of the
$this->hasField($x) test above the line:
if ($this->hasField($x) && ($whitelist && in_array($x,
$fieldList) || !$whitelist)) {
and it fails for the fields not in there. So that makes sense. But the
ridiculously frustrating thing is that the fields *are in the
database*. In the table that belongs to the model. Same name, same
capitalizations. I just can't figure out what the problem here is...
does anyone have any idea?
Joe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---