(編集済み)
私のhttp://host/MyCake/index.php/table/add
では、10 個の入力 (フィールド) を持つフォームを送信すると、
Error: SQLSTATE[23502]: Not null violation: 7
ERROR: null value in column "revista_id" violates not-null constraint
SQL Query:
INSERT INTO "fasciculos" ("created", "modified", "user_id") VALUES ('now()', 'now()', 1)
さて、「Not null violation」(フィールドrevista_id
) について (制約を外す) で SQL を変更してみるとALTER COLUMN revista_id DROP NOT NULL
、変更はOKで、実行されました! しかし、問題は次のとおりです。 * SQL INSERT の他の 10 フィールドはどこですか? !!
はい、私が変更したとき、送信されたデータ レコードは空で、10 個のフィールドすべてが NULL でした。
PostgreSQL 9.X を使用しています。
また、投稿されたデータがそこにあるかどうか、FasciculoController で var_dump を使用して確認しました。
public function add() {
if ($this->request->is('post')) {
$this->Fasciculo->create();
var_dump($this->request->data); // showing below
if ($this->Fasciculo->save($this->request->data)) // bug here!
...
}...
...}
vardump にはすべての POST データがあり、
array(1) {
["Fasciculos"]=>array(11) {
["other_id"]=> string(3) "540"
//... all data here ...
}
}