Skip to content

Method by name already exists in this class #21

@norgeindian

Description

@norgeindian

We have a third party module, which has the following plugin definition:

    <type name="Magento\Elasticsearch\Elasticsearch5\SearchAdapter\Mapper">
        <plugin name="XXX::updateElasticQuery"
                type="XXX\YYY\Plugin\Elasticsearch\SearchAdapter\Mapper"/>
    </type>
    <type name="Magento\Elasticsearch\ElasticAdapter\SearchAdapter\Mapper">
        <plugin name="XXX::UpdateElasticQuery"
                type="XXX\YYY\Plugin\Elasticsearch\SearchAdapter\Mapper"/>
    </type>

As you can see, the plugin name, is the same for both classes.
Now the issue is, that in Magento 2.4.7-p3, these classes extend from each other:

class Magento\Elasticsearch\Elasticsearch5\SearchAdapter\Mapper extends \Magento\Elasticsearch\ElasticAdapter\SearchAdapter\Mapper

As soon as I now run setup:di:compile, I get the following error message:

 A method by name ____plugin_XXX__updateElasticQuery already exists in this class.                                                                     
  Class Magento\Elasticsearch\Elasticsearch5\SearchAdapter\Mapper\Interceptor generation error

When I deactivate this module here and let Magento create the plugins as usual, I don't get any error anymore.
So I think it would be awesome if a way could be found to handle situations like that.
Anyone an idea how to approach that?

Metadata

Metadata

Assignees

No one assigned

    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