Commits

Michael Haschke committed 689f17d

[fix] Issue #2: undefined property notice in template is not thrown anymore, error in method to add the Foafpress event listeners is fixed now

Comments (0)

Files changed (1)

foafpressapp/core/Foafpress.php

     // Foafpress event handlers for SPCMS
     protected function SubscribeEventHandlers()
     {
-        if (defined('IS_PRODUCTION_INSTANCE') && IS_PRODUCTION_INSTANCE === true)
-        {
-            $this->pm->subscribe('sandbox_parse_start', $this, 'CheckCache');
-        }
+        
+        $this->pm->subscribe('sandbox_parse_start', $this, 'CheckCache');
         $this->pm->subscribe('sandbox_parse_failed', $this, 'FindResource');
         $this->pm->subscribe('sandbox_parse_end', $this, 'LoadResourceFromFile');
 
             $this->languageStackPreferences = null;
         }
 
-        $cacheOutput = false;
+        $cachedOutput = false;
 
         // check cache before doing anything
         if ($validCachedOutput = $this->cache->getVar($filename.serialize($this->languageStackPreferences)))
             $cachedOutput = $validCachedOutput;
             $this->pm->subscribe('sandbox_flush_start', $this, 'PreventDoubleOutput'); // only to be safe not to echo two times "the same"
         }
-        else
+        elseif (defined('IS_PRODUCTION_INSTANCE') && IS_PRODUCTION_INSTANCE === true)
         {
             $cachedOutput = $this->cache->getVar($filename.serialize($this->languageStackPreferences), null, -1);
         }
 
             //do post output processing here
         }
+        
+        return;
 
     }