save() returning false, but with no error in CakePHP

前端 未结 8 1821
一生所求
一生所求 2020-12-15 02:52

My debug value is set to 2, and it\'s displaying all the queries, except the one I need.

I have an Items controller method that is calling

相关标签:
8条回答
  • 2020-12-15 03:33

    Try this:

    if ($this->save()) {
        return $this->id;
    }
    else {
        var_dump($this->invalidFields());
        return false;
    }
    
    0 讨论(0)
  • 2020-12-15 03:40

    Have you got a beforeValidate() or beforeSave() method in the model or app model? Ifso, are they returning true? Failing that, use a debugger, set a break point in your IDE at the top of cake/libs/models/model.php save() method and step through the code until it returns false. Failing that add die('here'); calls.

    0 讨论(0)
提交回复
热议问题