[event_spartacus] Fix upgrade counter.

The plugin name was derived from its
install path - but bundled sidebar and
event plugins may share a path. So use
the name instead (and strip the instance
hash from it).

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2019-08-17 18:14:26 +02:00
parent 3730e77ddf
commit 0805014761
2 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,11 @@
2.38:
2.38.1:
-------
* Fix count_plugin_upgrades():
Don't get plugin name from path, as event and sidebar plugins
may share their path; strip instance from name instead.
2.38:
-----
* Add function to count upgradeable plugins.
* Add upgrade notifier to plugin upgrade button.
* Add 'backend_plugins_upgradecount' hook and

View File

@ -27,7 +27,7 @@ class serendipity_event_spartacus extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_SPARTACUS_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking');
$propbag->add('version', '2.38');
$propbag->add('version', '2.38.1');
$propbag->add('requirements', array(
'serendipity' => '1.6',
));
@ -1152,7 +1152,7 @@ class serendipity_event_spartacus extends serendipity_event
// Object is returned when a plugin could not be cached.
$bag = new serendipity_property_bag;
$plugin->introspect($bag);
$pluginname = get_object_vars($plugin)['act_pluginPath'];
$pluginname = explode(':', $class_data['name'])[0];
$version = $bag->get('version');
} elseif (is_array($plugin)) {
// Array is returned if a plugin could be fetched from info cache