Item11548: INCLUDE{warn="custom"} only works for topic-missing warnings.

pencil
Priority: Normal
Current State: Closed
Released In: 2.1.3
Target Release: patch
Applies To: Engine
Component: INCLUDE
Branches: Release02x01 master Item13897
Reported By: PaulHarvey
Waiting For:
Last Change By: GeorgeClark
TemiV identified an important bug. It seems custom error messages via VarINCLUDE's warn parameter is only supported on topic missing errors.

Access denied, for example, always shows the foswikiAlert, ignoring the custom warn.

Example:
%STARTSECTION{"code"}%%INCLUDE{
  "%TOPIC%Hidden"
  warn="Self-denial is a virtue"
}%%ENDSECTION{"code"}%

Test:

Self-denial is a virtue

-- PaulHarvey - 22 Feb 2012

Item11548Hidden

-- PaulHarvey - 22 Feb 2012

In addition, this task should also fix it so that warn uses Foswiki::Func::decodeFormatTokens()

-- PaulHarvey - 22 Feb 2012

I'm currently running with this ugly hack
diff --git a/lib/Foswiki/Macros/INCLUDE.pm b/lib/Foswiki/Macros/INCLUDE.pm
index e0c068d..14ba97d 100644
--- a/lib/Foswiki/Macros/INCLUDE.pm
+++ b/lib/Foswiki/Macros/INCLUDE.pm
@@ -98,7 +98,7 @@ sub _includeWarning {
 
         # different inlineAlerts need different argument counts
         my $argument = '';
-        if ( $message eq 'topic_not_found' ) {
+        if ( $message eq 'topic_not_found' or $message eq 'access_denied' ) {
             my ( $web, $topic ) = @_;
             $argument = "$web.$topic";
         }

-- PaulHarvey - 27 Mar 2012
 

ItemTemplate edit

Summary INCLUDE{warn="custom"} only works for topic-missing warnings.
ReportedBy PaulHarvey
Codebase 2.1.2, 2.1.1, 2.1.0, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.1.4, trunk
SVN Range
AppliesTo Engine
Component INCLUDE
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:276c5d2cf59b
TargetRelease patch
ReleasedIn 2.1.3
CheckinsOnBranches Release02x01 master Item13897
trunkCheckins
masterCheckins distro:276c5d2cf59b
ItemBranchCheckins distro:276c5d2cf59b
Release02x01Checkins distro:276c5d2cf59b
Release02x00Checkins
Release01x01Checkins
Topic revision: r6 - 18 Feb 2017, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy