|
12 | 12 |
|
13 | 13 | /**
|
14 | 14 | * Backend config model
|
15 |
| - * Used to save configuration |
16 | 15 | *
|
| 16 | + * Used to save configuration |
17 | 17 | * @author Magento Core Team <core@magentocommerce.com>
|
18 | 18 | * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
19 | 19 | * @api
|
@@ -122,6 +122,7 @@ public function __construct(
|
122 | 122 |
|
123 | 123 | /**
|
124 | 124 | * Save config section
|
| 125 | + * |
125 | 126 | * Require set: section, website, store and groups
|
126 | 127 | *
|
127 | 128 | * @throws \Exception
|
@@ -237,13 +238,14 @@ private function getField(string $sectionId, string $groupId, string $fieldId):
|
237 | 238 | * Get field path
|
238 | 239 | *
|
239 | 240 | * @param Field $field
|
| 241 | + * @param string $fieldId |
240 | 242 | * @param array &$oldConfig Need for compatibility with _processGroup()
|
241 | 243 | * @param array &$extraOldGroups Need for compatibility with _processGroup()
|
242 | 244 | * @return string
|
243 | 245 | */
|
244 |
| - private function getFieldPath(Field $field, array &$oldConfig, array &$extraOldGroups): string |
| 246 | + private function getFieldPath(Field $field, string $fieldId, array &$oldConfig, array &$extraOldGroups): string |
245 | 247 | {
|
246 |
| - $path = $field->getGroupPath() . '/' . $field->getId(); |
| 248 | + $path = $field->getGroupPath() . '/' . $fieldId; |
247 | 249 |
|
248 | 250 | /**
|
249 | 251 | * Look for custom defined field path
|
@@ -303,7 +305,7 @@ private function getChangedPaths(
|
303 | 305 | if (isset($groupData['fields'])) {
|
304 | 306 | foreach ($groupData['fields'] as $fieldId => $fieldData) {
|
305 | 307 | $field = $this->getField($sectionId, $groupId, $fieldId);
|
306 |
| - $path = $this->getFieldPath($field, $oldConfig, $extraOldGroups); |
| 308 | + $path = $this->getFieldPath($field, $fieldId, $oldConfig, $extraOldGroups); |
307 | 309 | if ($this->isValueChanged($oldConfig, $path, $fieldData)) {
|
308 | 310 | $changedPaths[] = $path;
|
309 | 311 | }
|
@@ -398,7 +400,7 @@ protected function _processGroup(
|
398 | 400 | $backendModel->addData($data);
|
399 | 401 | $this->_checkSingleStoreMode($field, $backendModel);
|
400 | 402 |
|
401 |
| - $path = $this->getFieldPath($field, $extraOldGroups, $oldConfig); |
| 403 | + $path = $this->getFieldPath($field, $fieldId, $extraOldGroups, $oldConfig); |
402 | 404 | $backendModel->setPath($path)->setValue($fieldData['value']);
|
403 | 405 |
|
404 | 406 | $inherit = !empty($fieldData['inherit']);
|
@@ -504,6 +506,7 @@ public function setDataByPath($path, $value)
|
504 | 506 |
|
505 | 507 | /**
|
506 | 508 | * Get scope name and scopeId
|
| 509 | + * |
507 | 510 | * @todo refactor to scope resolver
|
508 | 511 | * @return void
|
509 | 512 | */
|
|
0 commit comments