mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix for #2555
This commit is contained in:
parent
0c967cb011
commit
1c68b0902d
@ -106,6 +106,10 @@ class AccountValidator
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// whatever happens, source cannot equal destination:
|
||||
|
||||
|
||||
switch ($this->transactionType) {
|
||||
default:
|
||||
$this->destError = sprintf('AccountValidator::validateDestination cannot handle "%s", so it will always return false.', $this->transactionType);
|
||||
@ -508,7 +512,14 @@ class AccountValidator
|
||||
$this->destination = $search;
|
||||
|
||||
// must not be the same as the source account
|
||||
return !(null !== $this->source && $this->source->id === $this->destination->id);
|
||||
if (null !== $this->source && $this->source->id === $this->destination->id) {
|
||||
$this->sourceError = 'Source and destination are the same.';
|
||||
$this->destError = 'Source and destination are the same.';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user