Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item13064: force expert tabs with errors or warnings to appear. Error…
… when a key passed to tools/configure doesn't exists. Fix the ConfigureFilter checker so it works when there is no Foswiki session to provide users (e.g. when checking from the command line)
  • Loading branch information
crawford committed Nov 8, 2014
1 parent 330e91f commit b7d4d43
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Expand Up @@ -176,6 +176,8 @@ function _id_ify(id) {
}
report_data[level][id] = true;
$tab.addClass(level);
// Make sure the tab is visible if it has an error or warning
$tab.closest('li').addClass(level);
}

// Bubble reports up through the section hierarchy. Even if the
Expand Down Expand Up @@ -267,7 +269,6 @@ function _id_ify(id) {
$reports = $('#REP' + id); // key block report is there
$.each(r.reports, function(index, rep) {
has[rep.level]++;
if(rep.level == 'errors') debugger;
// Add the message type to the key block
$('#' + id + '_block').addClass(rep.level);
});
Expand Down
4 changes: 3 additions & 1 deletion core/lib/Foswiki/Configure/Checkers/ConfigureFilter.pm
Expand Up @@ -13,7 +13,9 @@ sub check_current_value {
# Checkers may be called in a script context, in which case
# Foswiki::Func is not available. However in a script context
# this option isn't interesting anyway.
return unless eval "require Foswiki::Func";
return
unless defined $Foswiki::Plugins::SESSION
&& eval "require Foswiki::Func";

my $it = Foswiki::Func::eachGroupMember( $Foswiki::cfg{SuperAdminGroup} );
my @admins;
Expand Down
10 changes: 8 additions & 2 deletions core/lib/Foswiki/Configure/Query.pm
Expand Up @@ -313,7 +313,6 @@ sub check_current_value {
if ( !$keys || scalar @$keys == 0 ) {
push( @$keys, '' );
}

my %check;
foreach my $k (@$keys) {

Expand All @@ -331,7 +330,14 @@ sub check_current_value {
}
else {
$k = "'$k'" unless $k =~ /^\{.*\}$/;
$reporter->ERROR("$k is not part of this .spec");
push(
@report,
{
keys => $k,
path => [],
reports => "$k is not part of this .spec"
}
);
}
}
}
Expand Down

0 comments on commit b7d4d43

Please sign in to comment.