Skip to content

Missing Call to $procede() #1763

Closed
Closed
@astorm

Description

@astorm

The following class

#File: app/code/Magento/Widget/Model/Resource/Layout/Plugin.php

is configured as a plugin

#File: app/code/Magento/Widget/etc/di.xml
    <plugin name="widget-layout-update-plugin"
            type="Magento\Widget\Model\Resource\Layout\Plugin" sortOrder="10"/>

However, the plugin's aroundGetDbUpdateString method

public function aroundGetDbUpdateString(
    \Magento\Framework\View\Model\Layout\Merge $subject,
    \Closure $proceed,
    $handle
) {
    return $this->update->fetchUpdatesByHandle($handle, $subject->getTheme(), $subject->getScope());
}

Does not have a called to $procede(). This seems like a bug/error/oversight (although, without the context of why this change was made, it's hard to say, which is why this is an issue and not a pull request).

Not calling $procede() here means that attempts to hook this method via another plugin will fail. Also, the presence of a Magento core team written around method without a call to $procede() may encourage bad practices in third party plugins. Finally, since there's no need for a call to $procede(), this should probably be an afterGetDbUpdateString method, and not an around method,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions