Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 5f98483

Browse files
jbradagelanivishal
authored andcommitted
Added $fieldId parameter into Config::getFieldPath method for fix of "clone_field" system config feature.
1 parent 0f57a30 commit 5f98483

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/code/Magento/Config/Model/Config.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,14 @@ private function getField(string $sectionId, string $groupId, string $fieldId):
227227
* Get field path
228228
*
229229
* @param Field $field
230+
* @param string $fieldId Need for support of clone_field feature
230231
* @param array &$oldConfig Need for compatibility with _processGroup()
231232
* @param array &$extraOldGroups Need for compatibility with _processGroup()
232233
* @return string
233234
*/
234-
private function getFieldPath(Field $field, array &$oldConfig, array &$extraOldGroups): string
235+
private function getFieldPath(Field $field, string $fieldId, array &$oldConfig, array &$extraOldGroups): string
235236
{
236-
$path = $field->getGroupPath() . '/' . $field->getId();
237+
$path = $field->getGroupPath() . '/' . $fieldId;
237238

238239
/**
239240
* Look for custom defined field path
@@ -293,7 +294,7 @@ private function getChangedPaths(
293294
if (isset($groupData['fields'])) {
294295
foreach ($groupData['fields'] as $fieldId => $fieldData) {
295296
$field = $this->getField($sectionId, $groupId, $fieldId);
296-
$path = $this->getFieldPath($field, $oldConfig, $extraOldGroups);
297+
$path = $this->getFieldPath($field, $fieldId, $oldConfig, $extraOldGroups);
297298
if ($this->isValueChanged($oldConfig, $path, $fieldData)) {
298299
$changedPaths[] = $path;
299300
}
@@ -374,7 +375,7 @@ protected function _processGroup(
374375
$backendModel->addData($data);
375376
$this->_checkSingleStoreMode($field, $backendModel);
376377

377-
$path = $this->getFieldPath($field, $extraOldGroups, $oldConfig);
378+
$path = $this->getFieldPath($field, $fieldId, $extraOldGroups, $oldConfig);
378379
$backendModel->setPath($path)->setValue($fieldData['value']);
379380

380381
$inherit = !empty($fieldData['inherit']);
@@ -580,4 +581,4 @@ public function getConfigDataValue($path, &$inherit = null, $configData = null)
580581

581582
return $data;
582583
}
583-
}
584+
}

0 commit comments

Comments
 (0)