Is it a bug?

model:

public class SomeModel
{
    public $id; //Not nullable
    public $fieldA; //Not nullable
    public $fieldB; //Not nullable
    .
    .
    .

controller:

public class SomeController
{
    public function SomeAction()
    {
        $someModel = SomeModel::findFirst(...);
        $someModel->fieldB = 123;
        $someModel->update();
        //if the original value of fieldA in db is empty string, it will raise an error here
        //fieldA is required
        .
        .
        .


11.1k

what version are you using?

Try using

public class SomeController
 {
     public function SomeAction()
     {
         $someModel = SomeModel::findFirst(...);
         $someModel->fieldB = 123;
         $someModel->save();

Instead of update



11.1k

Update to phalcon 2.0.4 , 2.0.3 had a issue with update when the record exsitis thats why its not updating , like casey said in 2.0.3 you had to use save instaed of update



15.5k

Both version 2.0.3, 2.0.4 and 2.0.5 have this issue.



2.2k

Did you try Dynamic Update?

That should only update the fields that you changed.