Skip to content

Commit 50b2e2e

Browse files
Fixed error in admin pannel.
1 parent bb13f10 commit 50b2e2e

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/Model/Block/Source/Block.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ public function getAllOptions()
5656
];
5757
}
5858

59-
array_unshift($this->_options, ['value' => '', 'label' => __('Please select a static block.')]);
59+
if (is_array($this->_options)) {
60+
array_unshift($this->_options, ['value' => '', 'label' => __('Please select a static block.')]);
61+
} else {
62+
$this->_options = ['value' => '', 'label' => __('No static blocks to select.')];
63+
}
6064
}
6165

6266
return $this->_options;

src/Model/Menu/Source/Menu.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ public function getAllOptions()
5252
];
5353
}
5454

55-
array_unshift($this->_options, ['value' => '', 'label' => __('Please select a menu.')]);
55+
if (is_array($this->_options)) {
56+
array_unshift($this->_options, ['value' => '', 'label' => __('Please select a menu.')]);
57+
} else {
58+
$this->_options = ['value' => '', 'label' => __('No menus to select.')];
59+
}
5660
}
5761

5862
return $this->_options;

src/Model/Product/Attribute/Source/VisibleOnFrontend.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ public function getAllOptions()
6565
];
6666
}
6767

68-
array_unshift($this->_options, ['value' => '', 'label' => __('Please select an attribute.')]);
68+
if (is_array($this->_options)) {
69+
array_unshift($this->_options, ['value' => '', 'label' => __('Please select an attribute.')]);
70+
} else {
71+
$this->_options = ['value' => '', 'label' => __('No attributes (visible on frontend) to select.')];
72+
}
6973
}
7074

7175
return $this->_options;

0 commit comments

Comments
 (0)