Item13944: Foswiki::Func::addToHEAD (deprecated in 2010) breaks with Foswiki 2.1 Zones rewrite.

pencil
Priority: Urgent
Current State: Closed
Released In: 2.1.1
Target Release: patch
Applies To: Engine
Component: FoswikiFunc
Branches: master Item13897
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
Here is the patch:

diff --git a/core/lib/Foswiki/Func.pm b/core/lib/Foswiki/Func.pm
index 3e43aed..851ce6b 100644
--- a/core/lib/Foswiki/Func.pm
+++ b/core/lib/Foswiki/Func.pm
@@ -3802,7 +3802,9 @@ See Foswiki:Development/UpdatingExtensionsScriptZone for more details.
 =cut
 
 sub addToHEAD {
-    $Foswiki::Plugins::SESSION->addToZone( 'head', @_ );
+    my $session = $Foswiki::Plugins::SESSION;
+    ASSERT($session) if DEBUG;
+    $session->zones()->addToZone('head', @_);
 }
 
 =begin TML

-- GeorgeClark - 04 Feb 2016

 

ItemTemplate edit

Summary Foswiki::Func::addToHEAD (deprecated in 2010) breaks with Foswiki 2.1 Zones rewrite.
ReportedBy GeorgeClark
Codebase 2.1.0
SVN Range
AppliesTo Engine
Component FoswikiFunc
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:7c038d0bcc90
TargetRelease patch
ReleasedIn 2.1.1
CheckinsOnBranches master Item13897
trunkCheckins
masterCheckins distro:7c038d0bcc90
ItemBranchCheckins distro:7c038d0bcc90
Release02x00Checkins
Release01x01Checkins
Topic revision: r5 - 01 May 2016, 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