mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for duplicate public ids/keys
This commit is contained in:
parent
6c731dfa49
commit
7b20db256e
@ -397,6 +397,13 @@ class EntityModel extends Eloquent
|
||||
$nextId = static::getNextPublicId($this->account_id);
|
||||
if ($nextId != $this->public_id) {
|
||||
$this->public_id = $nextId;
|
||||
if (env('MULTI_DB_ENABLED')) {
|
||||
if ($this->contact_key) {
|
||||
$this->contact_key = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
} elseif ($this->invitation_key) {
|
||||
$this->invitation_key = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
}
|
||||
}
|
||||
return $this->save($options);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user