websetup: Allow enabling plugins listed in disable_plugins.
The bug here was that disabling a plugin included thru goodstuff, like htmlscrubber, caused it to be added to disable_plugins, and those plugins were never loaded, so could not be re-enabled. Fix by allowing them to be force loaded when appropriate. (Also that allows disabled plugins to still record their setup options when dumping a setup file.)master
parent
89a970bd7d
commit
17592a951b
|
@ -592,10 +592,11 @@ sub loadplugins () {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub loadplugin ($) {
|
sub loadplugin ($;$) {
|
||||||
my $plugin=shift;
|
my $plugin=shift;
|
||||||
|
my $force=shift;
|
||||||
|
|
||||||
return if grep { $_ eq $plugin} @{$config{disable_plugins}};
|
return if ! $force && grep { $_ eq $plugin} @{$config{disable_plugins}};
|
||||||
|
|
||||||
foreach my $dir (defined $config{libdir} ? possibly_foolish_untaint($config{libdir}) : undef,
|
foreach my $dir (defined $config{libdir} ? possibly_foolish_untaint($config{libdir}) : undef,
|
||||||
"$installdir/lib/ikiwiki") {
|
"$installdir/lib/ikiwiki") {
|
||||||
|
|
|
@ -123,7 +123,7 @@ sub getsetup () {
|
||||||
# Load all plugins, so that all setup options are available.
|
# Load all plugins, so that all setup options are available.
|
||||||
my @plugins=IkiWiki::listplugins();
|
my @plugins=IkiWiki::listplugins();
|
||||||
foreach my $plugin (@plugins) {
|
foreach my $plugin (@plugins) {
|
||||||
eval { IkiWiki::loadplugin($plugin) };
|
eval { IkiWiki::loadplugin($plugin, 1) };
|
||||||
if (exists $IkiWiki::hooks{checkconfig}{$plugin}{call}) {
|
if (exists $IkiWiki::hooks{checkconfig}{$plugin}{call}) {
|
||||||
my @s=eval { $IkiWiki::hooks{checkconfig}{$plugin}{call}->() };
|
my @s=eval { $IkiWiki::hooks{checkconfig}{$plugin}{call}->() };
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low
|
||||||
else (still looks in old location for backwards compatability).
|
else (still looks in old location for backwards compatability).
|
||||||
* attachment: When inserting links, insert img directives for images,
|
* attachment: When inserting links, insert img directives for images,
|
||||||
if that plugin is enabled.
|
if that plugin is enabled.
|
||||||
|
* websetup: Allow enabling plugins listed in disable_plugins.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Fri, 11 Jun 2010 13:39:15 -0400
|
-- Joey Hess <joeyh@debian.org> Fri, 11 Jun 2010 13:39:15 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue