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 ($param->type == 2) {
|
||||||
if ($this->icon) {
|
if ($this->icon) {
|
||||||
$icon = Image::fromUploadedFile($this->icon);
|
$icon = Image::fromUploadedFile($this->icon);
|
||||||
$param->icon = $icon->id;
|
|
||||||
|
// 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) {
|
if ($this->iconGray) {
|
||||||
$iconGray = Image::fromUploadedFile($this->iconGray);
|
$iconGray = Image::fromUploadedFile($this->iconGray);
|
||||||
$param->iconGray = $iconGray->id;
|
|
||||||
|
if ($param->getAttribute('icon_gray') !== null) {
|
||||||
|
$param->iconGray = $iconGray->id;
|
||||||
|
} else {
|
||||||
|
$param->setAttribute('icon_gray', $iconGray->id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$param->setAttributes([
|
$param->setAttributes([
|
||||||
|
|
Loading…
Reference in New Issue