File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed
Controller/Adminhtml/Category Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -233,10 +233,11 @@ public function execute()
233
233
}
234
234
235
235
/**
236
- * @param $data
237
- * @return array
236
+ * @param array $data Category data
237
+ * @return mixed
238
+ * @throws \Magento\Framework\Exception\LocalizedException
238
239
*/
239
- public function imagePreprocessing ($ data )
240
+ public function imagePreprocessing (array $ data )
240
241
{
241
242
$ entityType = $ this ->eavConfig ->getEntityType (CategoryAttributeInterface::ENTITY_TYPE_CODE );
242
243
Original file line number Diff line number Diff line change @@ -64,8 +64,8 @@ public function __construct(
64
64
}
65
65
66
66
/**
67
- * @param $ value
68
- * @return string| bool
67
+ * @param array|bool|null $value Attribute value
68
+ * @return bool
69
69
*/
70
70
protected function getUploadedImageName ($ value )
71
71
{
Original file line number Diff line number Diff line change @@ -210,15 +210,17 @@ public function getData()
210
210
foreach ($ category ->getAttributes () as $ attributeCode => $ attribute ) {
211
211
$ backendModel = $ attribute ->getBackend ();
212
212
213
+ if (!isset ($ categoryData [$ attributeCode ])) {
214
+ continue ;
215
+ }
216
+
213
217
if ($ backendModel instanceof \Magento \Catalog \Model \Category \Attribute \Backend \Image) {
214
- if (isset ($ categoryData [$ attributeCode ])) {
215
- unset($ categoryData [$ attributeCode ]);
218
+ unset($ categoryData [$ attributeCode ]);
216
219
217
- $ categoryData [$ attributeCode ][0 ]['name ' ] = $ category ->getData ($ attributeCode );
218
- $ categoryData [$ attributeCode ][0 ]['url ' ] = $ category ->getImageUrl ($ attributeCode );
219
- }
220
+ $ categoryData [$ attributeCode ][0 ]['name ' ] = $ category ->getData ($ attributeCode );
221
+ $ categoryData [$ attributeCode ][0 ]['url ' ] = $ category ->getImageUrl ($ attributeCode );
220
222
}
221
- }
223
+ }
222
224
223
225
$ this ->loadedData [$ category ->getId ()] = $ categoryData ;
224
226
}
You can’t perform that action at this time.
0 commit comments