Skip to content

Commit

Permalink
Unique validation rule fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeping-owl committed Nov 17, 2014
1 parent 77e36ff commit 55db224
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

2014-11-17, v1.1.3
------------------

* Bugfix: Unique validation rule fixed

2014-11-08, v1.1.2
------------------

Expand Down
9 changes: 6 additions & 3 deletions src/SleepingOwl/Admin/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 55db224

Please sign in to comment.