Skip to content

Commit 71c0d96

Browse files
MAGETWO-64226: Add paths validation
1 parent 4beb52d commit 71c0d96

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

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

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,35 @@ protected function _getGroupFieldPathsByAttribute(array $fields, $parentPath, $a
255255
* Collects config paths and their structure paths from configuration files.
256256
* Returns the map of config paths and their structure paths.
257257
*
258-
* ```php
259-
* [
260-
* 'test_config/test_config/test_config' => [
261-
* 'test_structure/test_structure/test_structure'
262-
* ]
258+
* All paths are declared in module's system.xml.
259+
*
260+
* ```xml
261+
* <section id="section_id">
262+
* <group id="group_id" ...>
263+
* <field id="field_one_id" ...>
264+
* <label>Field One</label>
265+
* ...
266+
* </field>
267+
* <field id="field_two_id" ...>
268+
* <label>Field Two</label>
269+
* <config_path>section/group/field</config_path>
270+
* ...
271+
* </field>
272+
* </group>
273+
* </section>
263274
* ```
275+
* If <config_path> node does not exist, then config path duplicates structure path.
276+
* The result of this example will be:
277+
*
278+
* ```php
279+
* [
280+
* 'section_id/group_id/field_one_id' => [
281+
* 'section_id/group_id/field_one_id'
282+
* ],
283+
* 'section/group/field' => [
284+
* 'section_id/group_id/field_two_id'
285+
* ]
286+
*```
264287
*
265288
* @return array An array of config path to config structure path map
266289
*/

0 commit comments

Comments
 (0)