From 55db224344e2b06036bf8ce83b0e46aa7bf0891c Mon Sep 17 00:00:00 2001 From: Sleeping Owl Date: Mon, 17 Nov 2014 18:51:17 +0400 Subject: [PATCH] Unique validation rule fixed --- CHANGELOG | 5 +++++ src/SleepingOwl/Admin/Validation/Validator.php | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 71d768ae..3e01de3d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ CHANGELOG ========= +2014-11-17, v1.1.3 +------------------ + +* Bugfix: Unique validation rule fixed + 2014-11-08, v1.1.2 ------------------ diff --git a/src/SleepingOwl/Admin/Validation/Validator.php b/src/SleepingOwl/Admin/Validation/Validator.php index 1c31d451..12a868dc 100644 --- a/src/SleepingOwl/Admin/Validation/Validator.php +++ b/src/SleepingOwl/Admin/Validation/Validator.php @@ -53,10 +53,13 @@ protected function validateUrlStubFull($attribute, $value, $parameters) */ protected function validateUnique($attribute, $value, $parameters) { - $id = $this->customAttributes['id']; - if ($id !== null) + if (isset($this->customAttributes['id'])) { - $parameters[] = $id; + $id = $this->customAttributes['id']; + if ($id !== null) + { + $parameters[] = $id; + } } return parent::validateUnique($attribute, $value, $parameters); }