jonathangeiger / kohana-jelly

See the link below for the most up-to-date code
https://github.com/creatoro/jelly
MIT License
146 stars 34 forks source link

Filters don't have any effect when using Jelly_Model::save() #80

Closed Lokaltog closed 14 years ago

Lokaltog commented 14 years ago

When saving data using the Jelly_Model::save() method, field filters don't have any effect on the database. They get applied using validate()on jelly/model/core.php:414:

// Run validation
$data = $this->validate($data);

But $data isn't used in the foreach loop on line 422:

foreach ($this->_changed + $this->_original as $column => $value)

A possible fix for this issue is to use $data in the foreach loop:

foreach ($data as $column => $value)

With this fix the data saved in the database has the field filters applied. $data is already set correctly on line 398:

$data = ($this->_loaded OR $key) ? $this->_changed : $this->_changed + $this->_original;
jonathangeiger commented 14 years ago

Closed by ba4be25c3c8142d2053987cd8d408ad678b9d281. Thanks Lokaltog!