devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

Promote usage of ModifierPoolDataProvider instead of AbstractDataProvider in DataSource component topic

Open Pisikoll opened this issue 6 years ago • 2 comments

General issue

Use \Magento\Ui\DataProvider\ModifierPoolDataProvider instead of \Magento\Ui\DataProvider\AbstractDataProvider

https://devdocs.magento.com/guides/v2.2/ui_comp_guide/concepts/ui_comp_data_source.html

Description:

While researching how should I create custom data provider first place where google points is this page. In the Declaring the XML paragraph the doc mentions that \Magento\Ui\DataProvider\AbstractDataProvider coulde be used to satisfy all of the requirements. Next topic in concepts is About PHP modifiers in UI components which talks about modifiers and how to use them. For illustration \Magento\Catalog\Ui\DataProvider\Product\Form\ProductDataProvider is provided.

Why doesn't official doc promote usage of \Magento\Ui\DataProvider\ModifierPoolDataProvider and why doesn't ProductDataProvider inherit from ModifierPoolDataProvider? Quick search reveals that most of the modules in magento 2 default install are inheriting AbstractDataProvider making them harder to use for 3rd party modules. Since ModifierPoolDataProvider already inherits AbstractDataProvider this change should not break anything.

Possible solutions:

Promote usage of ModifierPoolDataProvider instead of AbstractDataProvider. Also change standard modules to use ModifierPoolDataProvider

Pisikoll avatar Jun 24 '20 15:06 Pisikoll

Hi @Pisikoll. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Jun 24 '20 15:06 m2-assistant[bot]

@magento I am working on this

dineshvb avatar Nov 10 '20 06:11 dineshvb