1
0

Don't show stackable-error on plugin upgrade (#45)

This commit is contained in:
onli
2014-06-09 21:42:17 +02:00
parent faae572342
commit 48f820cc33

View File

@ -344,17 +344,20 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
// we now have to check that the plugin is not already installed, or stackable, to prevent invalid double instances // we now have to check that the plugin is not already installed, or stackable, to prevent invalid double instances
$new_plugin = true; $new_plugin = true;
foreach (serendipity_plugin_api::get_installed_plugins() as $pluginName) { if ($fetchplugin_data['install']) {
if ($serendipity['GET']['install_plugin'] === $pluginName) { // spartacus will set this to false on upgrade, and we want to check this only on install
$existingPlugin =& serendipity_plugin_api::load_plugin($serendipity['GET']['install_plugin']); foreach (serendipity_plugin_api::get_installed_plugins() as $pluginName) {
if (is_object($existingPlugin)) { if ($serendipity['GET']['install_plugin'] === $pluginName) {
$bag = new serendipity_property_bag(); $existingPlugin =& serendipity_plugin_api::load_plugin($serendipity['GET']['install_plugin']);
$existingPlugin->introspect($bag); if (is_object($existingPlugin)) {
if ($bag->get('stackable') != true) { $bag = new serendipity_property_bag();
$new_plugin = false; $existingPlugin->introspect($bag);
if ($bag->get('stackable') != true) {
$new_plugin = false;
}
} }
break;
} }
break;
} }
} }