You are here: Foswiki>Tasks Web>Item12559 (19 Nov 2013, GeorgeClark)Edit Attach

Item12559: scope in EXPAND messes up the topic context (hot fix available)

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.9
Target Release: patch
Applies To: Engine
Component:
Branches: Release01x01
Reported By: MichaelDaum
Waiting For:
Last Change By: GeorgeClark
Following happens:

  1. pop topic context and throws it away, whatever it contained before ... ERROR
  2. push topic context as specified in scope
  3. pop topic context; this matches the previous push
  4. 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

 

ItemTemplate edit

Summary scope in EXPAND messes up the topic context (hot fix available)
ReportedBy MichaelDaum
Codebase 1.1.8, 1.1.7, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, trunk
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:89ad33dad0c5 distro:ee59c53a44dd
TargetRelease patch
ReleasedIn 1.1.9
CheckinsOnBranches Release01x01
trunkCheckins
Release01x01Checkins distro:89ad33dad0c5 distro:ee59c53a44dd
Topic revision: r5 - 19 Nov 2013, GeorgeClark - This page was cached on 29 Jun 2016 - 18:27.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License