File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
app/code/Magento/Catalog/Controller/Adminhtml/Category
dev/tests/integration/testsuite/Magento/Catalog/Model Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,30 @@ public function __construct(
81
81
?: \Magento \Framework \App \ObjectManager::getInstance ()->get (\Magento \Eav \Model \Config::class);
82
82
}
83
83
84
+ /**
85
+ * Filter category data
86
+ *
87
+ * @deprecated
88
+ * @param array $rawData
89
+ * @return array
90
+ */
91
+ protected function _filterCategoryPostData (array $ rawData )
92
+ {
93
+ $ data = $ rawData ;
94
+ if (isset ($ data ['image ' ]) && is_array ($ data ['image ' ])) {
95
+ if (!empty ($ data ['image ' ]['delete ' ])) {
96
+ $ data ['image ' ] = null ;
97
+ } else {
98
+ if (isset ($ data ['image ' ][0 ]['name ' ]) && isset ($ data ['image ' ][0 ]['tmp_name ' ])) {
99
+ $ data ['image ' ] = $ data ['image ' ][0 ]['name ' ];
100
+ } else {
101
+ unset($ data ['image ' ]);
102
+ }
103
+ }
104
+ }
105
+ return $ data ;
106
+ }
107
+
84
108
/**
85
109
* Category save
86
110
*
@@ -239,7 +263,7 @@ public function execute()
239
263
* @param array $data
240
264
* @return array
241
265
*/
242
- public function imagePreprocessing (array $ data )
266
+ public function imagePreprocessing ($ data )
243
267
{
244
268
$ entityType = $ this ->eavConfig ->getEntityType (CategoryAttributeInterface::ENTITY_TYPE_CODE );
245
269
Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ public function testSaveCategoryWithoutImage()
293
293
->isObjectNew (true );
294
294
295
295
$ repository ->save ($ model );
296
- $ this ->assertNull ($ model ->getImage ());
296
+ $ this ->assertEmpty ($ model ->getImage ());
297
297
}
298
298
299
299
/**
You can’t perform that action at this time.
0 commit comments