aljawaid / PluginManager

Replace the Installed Plugins section with a whole new interface. Plugin Manager provides both users and developers with an improved layout displaying a new section for troubleshooting plugins with a new plugin structure breakdown for each plugin. Install plugins directly or explore new upcoming or untested features from manual plugins.
MIT License
17 stars 3 forks source link

PM not load after latest update #59

Closed Abraka closed 1 year ago

Abraka commented 1 year ago

HI, I have a problem with update 4.0-4.1. When I update to one of those version, I get white page instead of plugin page. Kanboard 1.2.28 with PHP: 8.2.6.

aljawaid commented 1 year ago

v4.1 is not merged into the directory yet, so it will be 4.0 that is affecting you.

A white blank page could mean anything though. Check your logs for errors.

alfredbuehler commented 1 year ago

Yes, I see it crashes. Here some more info: Application version: 1.2.28 PHP version: 8.2.5

Fatal error: Uncaught TypeError: array_filter(): 
Argument #2 ($callback) must be a valid callback or null, non-static method Kanboard\Core\Plugin\Directory::isCompatible() 
cannot be called statically in /plugins/PluginManager/Helper/PluginManagerHelper.php:125 

Stack trace: 
#0 /plugins/PluginManager/Helper/PluginManagerHelper.php(125): array_filter(Array, Array) 
#1 /plugins/PluginManager/Template/plugin/sidebar.php(2): Kanboard\Plugin\PluginManager\Helper\PluginManagerHelper->getAllInstallablePlugins() 
#2 /app/Core/Template.php(83): include('/var/www/vhosts...') 
#3 /app/Template/plugin/layout.php(3): Kanboard\Core\Template->render('plugin/sidebar') 
#4 /app/Core/Template.php(83): include('/var/www/vhosts...') 
#5 /app/Helper/LayoutHelper.php(188): Kanboard\Core\Template->render('plugin/layout', Array) 
#6 /app/Helper/LayoutHelper.php(42): Kanboard\Helper\LayoutHelper->pageLayout('plugin/layout', Array) 
#7 /app/Helper/LayoutHelper.php(216): Kanboard\Helper\LayoutHelper->app('plugin/layout', Array) 
#8 /app/Helper/LayoutHelper.php(142): Kanboard\Helper\LayoutHelper->subLayout('plugin/layout', 'plugin/sidebar', 'plugin/show', Array) 
#9 /app/Controller/PluginController.php(24): Kanboard\Helper\LayoutHelper->plugin('plugin/show', Array) 
#10 /app/Core/Controller/Runner.php(77): Kanboard\Controller\PluginController->show() 
#11 /app/Core/Controller/Runner.php(31): Kanboard\Core\Controller\Runner->executeController() 
#12 /index.php(9): Kanboard\Core\Controller\Runner->execute() 
#13 {main} thrown in /plugins/PluginManager/Helper/PluginManagerHelper.php on line 125 
aljawaid commented 1 year ago

@alfredbuehler I am not getting any error on my side (php 7.4), do you think it will be resolved if I remove the quotes?

alfredbuehler commented 1 year ago

do you think it will be resolved if I remove the quotes?

No. You need static functions there.

alfredbuehler commented 1 year ago

I don't understand, why you are cloning this function, as it does the same as the original. Calling the original works:

    public function getAllInstallablePlugins($url = PLUGIN_API_URL)
    {
        return Directory::getInstance($this->container)->getAvailablePlugins($url);
        // $plugins = $this->httpClient->getJson($url);
        // $plugins = array_filter($plugins, array('Kanboard\Core\Plugin\Directory', 'isCompatible'));
        // $plugins = array_filter($plugins, array('Kanboard\Core\Plugin\Directory', 'isInstallable'));
        //
        // return $plugins;
    }
aljawaid commented 1 year ago

I don't understand, why you are cloning this function, as it does the same as the original. Calling the original works:

    public function getAllInstallablePlugins($url = PLUGIN_API_URL)
    {
        return Directory::getInstance($this->container)->getAvailablePlugins($url);
        // $plugins = $this->httpClient->getJson($url);
        // $plugins = array_filter($plugins, array('Kanboard\Core\Plugin\Directory', 'isCompatible'));
        // $plugins = array_filter($plugins, array('Kanboard\Core\Plugin\Directory', 'isInstallable'));
        //
        // return $plugins;
    }

is that code the fix? i dont understand myself but that's a longer story hahaha

alfredbuehler commented 1 year ago

Yes, you can change it that way if you really need this wrapper.

aljawaid commented 1 year ago

@alfredbuehler thanks a lot for that

@Abraka I have released v4.2 which is also pending the same merge in the directory, so the next update will be the latest v4.2, which will resolve the problem.

Abraka commented 1 year ago

is that code the fix? i dont understand myself but that's a longer story hahaha

Well, you did little scare me here man...

Anyway, thx for solutions.

aljawaid commented 1 year ago

don't forget to star the repos! :)

Abraka commented 1 year ago

perhaps, but not before I clean up my underwear :)