Skip to content

Commit

Permalink
Set all User props first before running ::setContent and ::setTransla…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
bastianallgeier committed Jun 25, 2024
1 parent 5c787f4 commit 73fd231
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Cms/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ public function __construct(array $props)
// so it also gets stored in propertyData prop
$props['id'] ??= $this->createId();

parent::__construct($props);

$this->id = $props['id'];
$this->email = $set('email', fn ($email) => Str::lower(trim($email)));
$this->language = $set('language', fn ($language) => trim($language));
$this->name = $set('name', fn ($name) => trim(strip_tags($name)));
$this->password = $props['password'] ?? null;
$this->role = $set('role', fn ($role) => Str::lower(trim($role)));

parent::__construct($props);

$this->setBlueprint($props['blueprint'] ?? null);
$this->setFiles($props['files'] ?? null);
}
Expand Down

0 comments on commit 73fd231

Please sign in to comment.