File tree 3 files changed +15
-3
lines changed
3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,11 @@ public function getAllOptions()
56
56
];
57
57
}
58
58
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
+ }
60
64
}
61
65
62
66
return $ this ->_options ;
Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ public function getAllOptions()
52
52
];
53
53
}
54
54
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
+ }
56
60
}
57
61
58
62
return $ this ->_options ;
Original file line number Diff line number Diff line change @@ -65,7 +65,11 @@ public function getAllOptions()
65
65
];
66
66
}
67
67
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
+ }
69
73
}
70
74
71
75
return $ this ->_options ;
You can’t perform that action at this time.
0 commit comments