[geeklog-hg] geeklog: The templateCode variable in the template class should ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Nov 28 11:47:13 EST 2015


changeset 9655:0ada0e03a73b
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/0ada0e03a73b
user: Tom
date: Sat Nov 28 11:46:30 2015 -0500
description:
The templateCode variable in the template class should be private but needs to be public due to a hack in lib-story.php around line 649. This hack needs to be in place to handle if the templates caching is disabled but articles are still being cached.

This hack should be changed in the future: either set_var or set_file functions in the template class need to allow update of the file template variable found in templatecode.

diffstat:

 system/classes/template.class.php |  3 ++-
 system/lib-story.php              |  4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r a35c4f1dbfbf -r 0ada0e03a73b system/classes/template.class.php
--- a/system/classes/template.class.php	Sat Nov 28 10:26:21 2015 -0500
+++ b/system/classes/template.class.php	Sat Nov 28 11:46:30 2015 -0500
@@ -140,7 +140,8 @@
      * @var       array
      * @see       set_file
      */
-    private $templateCode = array();
+    // Hack (see Geeklog Bug Tracker issue #0001817): $templateCode should be private but cannot because of some lib-story code
+    public $templateCode = array();
 
     /**
      * A hash of strings forming a translation table which translates variable names
diff -r a35c4f1dbfbf -r 0ada0e03a73b system/lib-story.php
--- a/system/lib-story.php	Sat Nov 28 10:26:21 2015 -0500
+++ b/system/lib-story.php	Sat Nov 28 11:46:30 2015 -0500
@@ -646,11 +646,11 @@
         PLG_templateSetVars($article_filevar, $article);
 
         if (!$_CONF['cache_templates']) {
-            // $article->set_var($article_filevar, $retval);
-            // Hack: Cannot set the template variable directly with set_var since
+            // Hack (see Geeklog Bug Tracker issue #0001817): Cannot set the template variable directly with set_var since
             // this template variable was set with set_file which uses the templatecode array (set_var uses varvals array)
             // so have to update the templatecode array directly. This array really shouldn't be accessed this way
             // and this hack should be changed in the future: either set_var or set_file functions need to allow update of the file template variable found in templatecode
+            // $article->set_var($article_filevar, $retval);
             $article->templateCode[$article_filevar] = $retval;
         }
     }



More information about the geeklog-cvs mailing list