Skip to content

Commit 8a5ff8f

Browse files
committed
MAGETWO-91570: [2.2.x] - [Github]Can not save attribute #5907
- CR notes
1 parent f3d5e73 commit 8a5ff8f

File tree

1 file changed

+4
-4
lines changed
  • app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute

1 file changed

+4
-4
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function execute()
125125
{
126126
$data = $this->getRequest()->getPostValue();
127127
if ($data) {
128-
$this->extractOptionsData($data);
128+
$this->preprocessOptionsData($data);
129129
$setId = $this->getRequest()->getParam('set');
130130

131131
$attributeSet = null;
@@ -318,25 +318,25 @@ public function execute()
318318
}
319319

320320
/**
321-
* Extract options data from serialized options field.
321+
* Extract options data from serialized options field and append to data array.
322322
*
323323
* This logic is required to overcome max_input_vars php limit
324324
* that may vary and/or be inaccessible to change on different instances.
325325
*
326326
* @param array $data
327327
* @return void
328328
*/
329-
private function extractOptionsData(&$data)
329+
private function preprocessOptionsData(&$data)
330330
{
331331
if (isset($data['serialized_options'])) {
332-
unset($data['option']);
333332
$serializedOptions = json_decode($data['serialized_options'], JSON_OBJECT_AS_ARRAY);
334333
foreach ($serializedOptions as $serializedOption) {
335334
$option = [];
336335
parse_str($serializedOption, $option);
337336
$data = array_merge_recursive($data, $option);
338337
}
339338
}
339+
unset($data['serialized_options']);
340340
}
341341

342342
/**

0 commit comments

Comments
 (0)