Skip to content

PluginManager doesn't find replaced plugins #575

@cstorus

Description

@cstorus

Winter CMS Build

1.2

PHP Version

8.1

Database engine

MySQL/MariaDB

Plugins installed

Skripteria.SiteSearch, Winter.Blog, Winter.Pages

Issue description

The Winter PluginManager->hasPlugin() method doesn't correctly identify replaced plugins. This appears to be caused by searching the replacementMap array using the normalized identifier, however the array is keyed using non-normalized identifiers.

    public function hasPlugin(PluginBase|string $plugin): bool
    {
        $normalized = $this->getNormalizedIdentifier($plugin);

        return isset($this->plugins[$normalized]) || isset($this->replacementMap[$normalized]);
    }

image

Steps to replicate

Create a replacement plugin with a replaced identifier
Search for the original plugin identifier using the PluginManager

Workaround

Amend the hasPlugin function in PluginManager:476 to use the non-normalized identifier when looking up in the replacementMap.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions