Opened 9 years ago

Closed 9 years ago

#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


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/

    656656            $locale->AddCatalogLookupPathPrefix($dir); 
    657657        } 
    658658    } 
     660    # update version for enabled plugins 
     661    Padre::DB::Plugin->update_version( 
     662        $module => $module->VERSION, 
     663    ); 
    660665    # FINALLY we can enable the plug-in 
    661666    $plugin->enable; 
    12411246# LICENSE 
    12421247# This program is free software; you can redistribute it and/or 
    12431248# modify it under the same terms as Perl 5 itself. 
  • lib/Padre/DB/

    2626    ); 
     29# Set version for an object 
     30sub update_version { 
     31    Padre::DB->do( 
     32        'update plugin set version = ? where name = ?', {}, 
     33        $_[2], $_[1], 
     34    ); 
    260268Returns true, or throws an exception on error. 
     270=head2 update_version 
     272    Padre::DB::Plugin->update_version( 
     273        $module => $module->VERSION, 
     274    ); 
     276Update Version of Plugin, enables Config.DB to be keeped upto date. 
    262278=head1 ACCESSORS 
    264280=head2 name 

a P-P-Cookbook by product :)

Change History (3)

comment:1 Changed 9 years ago by szabgab

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?

comment:2 Changed 9 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 :(

comment:3 Changed 9 years ago by bowtie

  • Resolution set to fixed
  • Status changed from new to closed

This has bean implemented in r14980, not as is, but with modification by Alias++

Note: See TracTickets for help on using tickets.