fuel/core — Issue #849: Model_Crud : update isn't updating values after save()
Author: krtek4
Created: 2012-02-26 10:53:08+00:00
State: open

When calling save() on a Model_Crud instance for an existing row in the database, the values of the object aren't updated correctly.

The problem is on the line 507 :

$result[1] > 0 and $this->set($vars);

In case of an update, $result is not an array but directly the number of affected rows (according to the query documentation : `* @return integer number of affected rows for all other queries`), so the check should be :

$result > 0 and $this->set($vars);