diff --git a/dblayeroo.php b/dblayeroo.php index 92c269c..11650ba 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -2340,10 +2340,17 @@ class dblayeroo // - If foreign keys, check if the value is set in the constraint foreach ($this->foreign as $field=>$params) { + // Do not test in update if the field is not provided as it was already + // recorded + if ($update === true && ! array_key_exists ($field, $values)) + continue; if (! array_key_exists ($field, $values)) + { $errors[$field] = sprintf (dgettext ("domframework", "The field '%s' must be test on foreign, but is not provided"), $field); + continue; + } if (! array_key_exists ($params[0], $this->setForeignObj)) $this->DBException (sprintf (dgettext ("domframework", "No foreign object configured to test the foreign key for table '%s'"),