Fix error in unique fields validation
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1429 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -333,6 +333,7 @@ class dblayer extends PDO
|
||||
{
|
||||
if (is_array ($columns))
|
||||
{
|
||||
// Multiple columns in unique
|
||||
$select = array ();
|
||||
$select[] = array ($this->primary, $updatekey, "!=");
|
||||
foreach ($columns as $col)
|
||||
@@ -354,11 +355,10 @@ class dblayer extends PDO
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME ! Problem if $datasOK contains primary / else can be warned on
|
||||
// $datasOK[$columns] if it doesn't exists
|
||||
if (array_key_exists ($columns, $datasOK)) continue;
|
||||
// One column in unique
|
||||
if (!array_key_exists ($columns, $datasOK)) continue;
|
||||
$select = array ();
|
||||
if ($columns !== $this->primary)
|
||||
if ($columns === $this->primary)
|
||||
$select[] = array ($this->primary, $updatekey, "!=");
|
||||
$select[] = array ($columns, $datasOK[$columns]);
|
||||
$rc = $this->read ($select,
|
||||
|
||||
Reference in New Issue
Block a user