fix: undefined behaviour in ParameterForm edit
This commit is contained in:
parent
6f246afc8f
commit
821ed27b2c
|
@ -55,11 +55,22 @@ class ParameterForm extends Model
|
|||
if ($param->type == 2) {
|
||||
if ($this->icon) {
|
||||
$icon = Image::fromUploadedFile($this->icon);
|
||||
|
||||
// https://rent4health.com/wp-content/uploads/2020/02/Under-arm-crutches-1.png
|
||||
if ($param->getAttribute('icon') !== null) {
|
||||
$param->icon = $icon->id;
|
||||
} else {
|
||||
$param->setAttribute('icon', $icon->id);
|
||||
}
|
||||
}
|
||||
if ($this->iconGray) {
|
||||
$iconGray = Image::fromUploadedFile($this->iconGray);
|
||||
|
||||
if ($param->getAttribute('icon_gray') !== null) {
|
||||
$param->iconGray = $iconGray->id;
|
||||
} else {
|
||||
$param->setAttribute('icon_gray', $iconGray->id);
|
||||
}
|
||||
}
|
||||
|
||||
$param->setAttributes([
|
||||
|
|
Loading…
Reference in New Issue