Adding a new fieldset to the admin category editor changes the position of the 'General' fieldset. #15041
Labels
Component: Catalog
Fixed in 2.2.x
The issue has been fixed in 2.2 release line
Fixed in 2.3.x
The issue has been fixed in 2.3 release line
good first issue
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Reproduced on 2.2.x
The issue has been reproduced on latest 2.2 release
Reproduced on 2.3.x
The issue has been reproduced on latest 2.3 release
Hi,
When a custom fieldset is added to the admin category editor, the General section (the one with "Enable category", "Include in Menu" and "Category Name") moves to the last position of the form.
It seems that this issue was already reported by somebody else in #5300, but it was closed. The problem remains, so I decided to open a new one.
Preconditions
I'm using Magento 2.2.3, PHP 7.1.16 and MySQL 5.7.22 with a default installation.
Steps to reproduce
Create a new module with the basic files (
composer.json
,etc/module.xml
,registration.php
, as specified in the developer documentation), and add theview/adminhtml/ui_component/category_form.xml
file, with the following content:There's no need to add a new category attribute. With just the new fieldset the problem appears.
Expected result
The general section, and its fields, should be at the top of the form so the category name is clearly visible:
Actual result
The general section is placed at the bottom of the form:
Workaround and possible solution
This seems to be related to the fact that the
general
fieldset doesn't have a configuredsortOrder
. Invendor/magento/module-catalog/view/adminhtml/ui_component/category_form.xml
, you can see:When adding a custom fieldset, somehow the fieldset gets merged in a different position of the resulting XML, giving a different display order. This can be confusing for site administrators (since the category name can be hidden below the fold if the website uses several extensions), and it's also confusing for developers.
A simple workaround is to add the
sortOrder
in our custom module'scategory_form.xml
:A proper fix would be to add the
sortOrder
to the definition in theMagento_Catalog
module itself. In itscategory_form.xml
file:The text was updated successfully, but these errors were encountered: