It seems that Spartacus checks version information just on a string comparision. Any chance of trying to convert the versions to numbers (and if it fails, then just do a string match), or splitting on the . and comparing per level (ie 1.1 < 1.3, 1.1.1 < 1.1.3, 1.1 < 1.1.1)?
Sidebar Hider Upgrade
Shrinks Sidebars to just their titles. Extra configuration in Entries -> Manage Sidebars in the Admin Suite.
Author: Tys von Gaza; version: 1.3; Upgrade to version 1.1
Plugin version numbers?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Plugin version numbers?
Yes, you're right, we currently only use exact stringmatching in spartacus, line 222:
which may be patched to this:
We should be able to use version_compare logic there easily, but I'm afraid it might break some stuff.
As the problem only arises when you locally develop plugins and not have them in the repository yet, I'd like to postpone a bugfix until Serendipity 0.9 development begins (in 1-2 weeks)
Regards,
Garvin
Code: Select all
if ($bag->get('version') == $pluginstack[$i]['version']) {
$installable = false;
} else {
$pluginstack[$i]['upgradable'] = true;
$pluginstack[$i]['upgrade_version'] = $pluginstack[$i]['version'];
$pluginstack[$i]['version'] = $bag->get('version');
$upgradeLink = '&serendipity[spartacus_upgrade]=true';
}
Code: Select all
if ($bag->get('version') == $pluginstack[$i]['version']) {
$installable = false;
} elseif (version_compare($bag->get('version'), $pluginstack[$i]['version'], '<')) {
$pluginstack[$i]['upgradable'] = true;
$pluginstack[$i]['upgrade_version'] = $pluginstack[$i]['version'];
$pluginstack[$i]['version'] = $bag->get('version');
$upgradeLink = '&serendipity[spartacus_upgrade]=true';
}
As the problem only arises when you locally develop plugins and not have them in the repository yet, I'd like to postpone a bugfix until Serendipity 0.9 development begins (in 1-2 weeks)
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/