aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2014-09-25 09:25:24 +0000
committermistic100 <mistic@piwigo.org>2014-09-25 09:25:24 +0000
commit0f0b8e0430fd4bb6f7df76d2d7a1b54e99b744d3 (patch)
tree082945463a14688bf547fdc6061952ac3116c375 /admin
parent64b7e77a5ac3e9797d924b1671288056ca6aac90 (diff)
final fix for plugins update ?
- plugins.version is not updated in "activate" action - plugins.version is updated in "update" action and "load_plugin()" function (not only for plugins using maintain.class.php) cases covered: - autoupdate while active or inactive - FTP update while active or inactive git-svn-id: http://piwigo.org/svn/trunk@29779 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/include/plugins.class.php21
1 files changed, 15 insertions, 6 deletions
diff --git a/admin/include/plugins.class.php b/admin/include/plugins.class.php
index 88971b000..71093a6c1 100644
--- a/admin/include/plugins.class.php
+++ b/admin/include/plugins.class.php
@@ -152,17 +152,27 @@ INSERT INTO '. PLUGINS_TABLE .' (id,version)
case 'update':
$previous_version = $this->fs_plugins[$plugin_id]['version'];
- $upgrade_status = $this->extract_plugin_files('upgrade', $options['revision'], $plugin_id);
+ $errors[0] = $this->extract_plugin_files('upgrade', $options['revision'], $plugin_id);
- if ($upgrade_status === 'ok')
+ if ($errors[0] === 'ok')
{
$this->get_fs_plugin($plugin_id); // refresh plugins list
+ $new_version = $this->fs_plugins[$plugin_id]['version'];
$plugin_maintain = self::build_maintain_class($plugin_id);
- $plugin_maintain->update($previous_version, $this->fs_plugins[$plugin_id]['version']);
+ $plugin_maintain->update($previous_version, $new_version, $errors);
+
+ if ($new_version != 'auto')
+ {
+ $query = '
+UPDATE '. PLUGINS_TABLE .'
+ SET version=\''. $new_version .'\'
+ WHERE id=\''. $plugin_id .'\'
+;';
+ pwg_query($query);
+ }
}
- return $upgrade_status;
break;
case 'activate':
@@ -186,8 +196,7 @@ INSERT INTO '. PLUGINS_TABLE .' (id,version)
{
$query = '
UPDATE '. PLUGINS_TABLE .'
- SET state=\'active\',
- version=\''. $this->fs_plugins[$plugin_id]['version'] .'\'
+ SET state=\'active\'
WHERE id=\''. $plugin_id .'\'
;';
pwg_query($query);