Skip to content

Disabled plugins are still being called #14

@hatimeria-artur-jewula

Description

@hatimeria-artur-jewula

When I create a di config in which I want to disable some plugin in given scope the resulted Interceptor still calls the original plugin. For example create a webapi/di.xml in a module with the following content:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Model\ResourceModel\Eav\Attribute">
        <plugin name="save_swatches_option_params" disabled="true"/>
    </type>
</config>

My expectation is that this plugin will not be called when the rest request. However the generated interceptor is

/**
 * {@inheritdoc}
 */
public function beforeSave()
{
    $arguments = func_get_args();
    $this->____plugin_save_swatches_option_params()->beforeBeforeSave($this, ...array_values($arguments));

    return parent::beforeSave(...array_values($arguments));
}

/**
 * {@inheritdoc}
 */
public function afterSave()
{
    $arguments = func_get_args();
    $result = parent::afterSave(...array_values($arguments));

    return (($tmp = $this->____plugin_save_swatches_option_params()->afterAfterSave($this, $result, ...array_values($arguments))) !== null) ? $tmp : $result;
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions