Skip to content

using plugin['title'] for logical checks is utterly incorrect #73

@imfx77

Description

@imfx77

I have just placed the following PR to Kanboard:
a fix for the plugin directory

In PluginManager you have most probably borrowed that ill-considered code, and did build upon it, and did multiply it for various purposes. This makes it a bit more tangled at your side 🤔
They may choose to merge or to ignore my PR in Kanboard, but it doesn't concern you either way since you override the entire behavior.

So, have a look at the PR changes and consider applying them analogically to PluginManager/Template/plugin/directory.php.

<?php foreach ($available_plugins as $plugin): ?>

However, bear in mind that the $available_plugins is an associative array of the form (key => value), the "key" being the plugin name and the "value" an array of the plugin properties.
And you have an extra problem because you effectively destroy the keys when you sort the array here:

<?php usort($available_plugins, fn ($a, $b) => strtolower($a['title']) <=> strtolower($b['title'])); ?>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions