From 534f4de5203b8625b0b460d4743dc87c574ebb9e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 11 Jan 2020 17:31:32 +0100 Subject: [PATCH] Fix an issue where users were unable to create revenue / expense account combinations with the same name. #2987 --- app/Validation/FireflyValidator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 60492ad5f6..32880b31bc 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -375,13 +375,14 @@ class FireflyValidator extends Validator */ public function validateUniqueAccountForUser($attribute, $value, $parameters): bool { + // because a user does not have to be logged in (tests and what-not). if (!auth()->check()) { return $this->validateAccountAnonymously(); } - if (isset($this->data['what'])) { + if (isset($this->data['objectType'])) { - return $this->validateByAccountTypeString($value, $parameters, $this->data['what']); + return $this->validateByAccountTypeString($value, $parameters, $this->data['objectType']); } if (isset($this->data['type'])) { return $this->validateByAccountTypeString($value, $parameters, $this->data['type']);