-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Summary (*)
Environment: Magento 2.2-develop, Magento 2.3-develop
As a Magento developer, I want to add some additional settings to the Newsletter system configuration before Success Email Template (as example).
Examples (*)
Within a custom module, in the adminhtml/system.xml file, add a new field before Success Email Template, like following:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="newsletter">
<tab>customer</tab>
<group id="subscription">
<field id="custom_field" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Do some more stuff after subscription ?</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
</section>
</system>
</config>
Actual results
With given above, the custom field will appear at the end of fields list in scope of Newsletter system configuration.
Expected result
Newly added field should be sorted according to given sortOrder value.
*The issue
The problem is that in the app/code/Magento/Newsletter/etc/adminhtml/system.xml group fields has sortOrder the same - 1.
Proposed solution
In the app/code/Magento/Newsletter/etc/adminhtml/system.xml group fields has sortOrder with a step of 10. So each additional field will get previous sortOrder value + 10.