#6513: When updating rows with Model::saveAll(), it is filling in missing fields
with possibly invalid MySQL default values
---------------------------+------------------------------------------------
Reporter: mattalexx | Type: Bug
Status: new | Priority: Medium
Milestone: 1.2.x.x | Component: Model
Version: 1.2 Final | Severity: Normal
Keywords: | Php_version: PHP 5
Cake_version: 1.2.3.8166 |
---------------------------+------------------------------------------------
= Summary =
When updating a row with Model::saveAll(), it is filling in missing fields
with possibly invalid MySQL default values, thus invalidating the save.
This behavior seems appropriate for inserts but not for updates.
= Steps to reproduce =
1. Set up a fresh install of version 1.2.3.8166.
1. Set up a MySQL database.
1. Run the included SQL file (see attached "test.tar.gz").
1. Overwrite your app folder with the one included (see attached
"test.tar.gz").
1. Run http://www.example.com/widgets/test in your browser.
= Expected results =
Successful save.
= Results =
Failed save because of validation errors.
= Notes =
The save failed because saveAll noticed that the number field was absent
from the data and tried to set it to its default (MySQL) value, 0, which
is against validation. The value of that field as it is in the database is
valid, however.
--
Ticket URL: <https://trac.cakephp.org/ticket/6513>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets 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/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---