Item12559: scope in EXPAND messes up the topic context (hot fix available)
Priority: Urgent
Current State: Closed
Released In: 1.1.9
Target Release: patch
Applies To: Engine
Component:
Branches: Release01x01
Following happens:
- pop topic context and throws it away, whatever it contained before ... ERROR
- push topic context as specified in
scope
- pop topic context; this matches the previous push
- push topic context BASEWEB.BASETOPIC ... ERROR
(1) and (4) are superfluous.
This error exists since EXPAND was introduced 4 years ago in
distro:2d8233cbb808 (not sure which foswiki revision this matches)...flagging all 1.1.x engines.
Hot fix:
Index: lib/Foswiki/Macros/EXPAND.pm
===================================================================
--- lib/Foswiki/Macros/EXPAND.pm (revision 16803)
+++ lib/Foswiki/Macros/EXPAND.pm (working copy)
@@ -20,7 +20,6 @@
$meta = new Foswiki::Meta( $this, $web, $topic );
return $this->inlineAlert( 'alerts', 'EXPAND_noaccess', $scope )
unless $meta->haveAccess('VIEW');
- $this->{prefs}->popTopicContext();
$this->{prefs}->pushTopicContext( $web, $topic );
}
else {
@@ -30,8 +29,6 @@
my $expansion = $meta->expandMacros($macro);
if ($scope) {
$this->{prefs}->popTopicContext();
- $this->{prefs}
- ->pushTopicContext( $this->{webName}, $this->{topicName} );
}
return $expansion;
}
--
MichaelDaum - 01 Aug 2013