Skip to content

Inconsistent location for plugins #2291

@ashsmith

Description

@ashsmith

I have noticed in app/code/Magento/CatalogUrlRewrite the location where Plugins are kept is inconsistent between Blocks & Models.

So in the code below (from app/code/Magento/CatalogUrlRewrite/etc/adminhtml/di.xml) shows Plugins for Models stored in the Model directory, but then Blocks and Controller Plugins are kept in a Plugins directory within the root of the module.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    ...
    <type name="Magento\UrlRewrite\Model\StorageInterface">
        <plugin name="storage_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Storage"/>
    </type>
    <type name="Magento\Catalog\Block\Adminhtml\Category\Tab\Attributes">
        <plugin name="category_form_url_key_plugin" type="Magento\CatalogUrlRewrite\Plugin\Catalog\Block\Adminhtml\Category\Tab\Attributes"/>
    </type>
    ...
    <type name="Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper">
        <plugin name="product_save_rewrites_history_plugin" type="Magento\CatalogUrlRewrite\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper"/>
    </type>
</config>

Is there a reason behind this? Was it intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Event: mm19brIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasebug reportgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions