Ticket #1253 (closed enhancement: fixed)
Update Plugin Version in Config.DB for enabled plugins only, please add to trunk :)
| Reported by: | bowtie | Owned by: | bowtie |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | plugins | Version: | 0.86 |
| Keywords: | Plugin version | Cc: | Alias |
Description
I noticed that the Plugins DB was not being updated when a plugin version changed, so here is a fix. for active plugins only.
-
lib/Padre/PluginManager.pm
656 656 $locale->AddCatalogLookupPathPrefix($dir); 657 657 } 658 658 } 659 660 # update version for enabled plugins 661 Padre::DB::Plugin->update_version( 662 $module => $module->VERSION, 663 ); 659 664 660 665 # FINALLY we can enable the plug-in 661 666 $plugin->enable; … … 1241 1246 # LICENSE 1242 1247 # This program is free software; you can redistribute it and/or 1243 1248 # modify it under the same terms as Perl 5 itself. 1244
-
lib/Padre/DB/Plugin.pm
26 26 ); 27 27 } 28 28 29 # Set version for an object 30 sub update_version { 31 Padre::DB->do( 32 'update plugin set version = ? where name = ?', {}, 33 $_[2], $_[1], 34 ); 35 } 36 29 37 1; 30 38 31 39 __END__ … … 259 267 260 268 Returns true, or throws an exception on error. 261 269 270 =head2 update_version 271 272 Padre::DB::Plugin->update_version( 273 $module => $module->VERSION, 274 ); 275 276 Update Version of Plugin, enables Config.DB to be keeped upto date. 277 262 278 =head1 ACCESSORS 263 279 264 280 =head2 name
a P-P-Cookbook by product :)
Change History
comment:2 Changed 2 years ago by bowtie
it's only when you look at ConfigDB via Cookbook do you see it's wrong,
also do we not want all plugins to use ConfigDB and config.ymal for Padre settings?
We can also now check if a previous version was installed.
If we arn't going to update it, then why do we need it.
this would mean that Version and Config are superfluous attributes then :(
Note: See
TracTickets for help on using
tickets.

It seems like an easy fix but I wonder why do we care to keep the version numbers in the database? Where do we use them?