Skip to content

Commit

Permalink
Fix setting null profile extras order
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Jan 23, 2025
1 parent 83e7f98 commit 37c4d11
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/Models/UserProfileCustomization.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function forUser(?User $user): array|static
return $ret;
}

public static function repairExtrasOrder($value)
public static function repairExtrasOrder(array $value): array
{
// read from inside out
return array_values(
Expand Down Expand Up @@ -316,7 +316,10 @@ public function getExtrasOrderAttribute($value)
public function setExtrasOrderAttribute($value)
{
$this->attributes['extras_order'] = null;
$this->setOption('extras_order', static::repairExtrasOrder($value));
$this->setOption(
'extras_order',
$value === null ? null : static::repairExtrasOrder($value),
);
}

public function getProfileCoverExpandedAttribute()
Expand Down

0 comments on commit 37c4d11

Please sign in to comment.