[geeklog-devel] Geeklog-Nightly fail to install

Erwan HAMON hamon.erwan at free.fr
Tue Oct 8 16:29:42 EDT 2013


Hi,

I've created myself an account on Mantis but cannot report bugs against
2.1.0 or nightly.

Here is a wicked bug and a patch.

Geeklog-Nightly Build #524 (Oct 1, 2013 8:02:22 AM) fails to install and
only leaves this message in the error.log:

Thu Oct  3 07:23:50 2013 - ::1 - 2 - file_put_contents(instance__topic_tree__c81e728d9d4c2f636f067f89cc14862c.php): failed to open stream: Permission denied @ 
/path/to/geeklog-nightly/system/classes/template.class.php line 2091 

It took me a while to find out it's because lib-common, hence 
template.class.php, is included from within a function. 
$TEMPLATE_OPTIONS is initialised as a local variable within that 
function's scope. The global $TEMPLATE_OPTIONS remains null.

Bellow is a patch that allows the install to get thru, but it might be 
better to review $TEMPLATE_OPTIONS' initialisation or to forbid includes 
from within a function:

--- /path/to/vanilla/geeklog-nightly/public_html/lib-common.php    2013-10-01 14:03:12.000000000 +0200
+++ /path/to/my/geeklog-nightly/public_html/lib-common.php     2013-10-08 19:01:01.652876627 +0200
@@ -527,7 +527,9 @@
     $_TOPICS = TOPIC_buildTree(TOPIC_ROOT, true);
 
     // Save updated topic tree and date
-    CACHE_create_instance($cacheInstance, serialize($_TOPICS), true);
+    if (isset($GLOBALS['TEMPLATE_OPTIONS']) && is_array($TEMPLATE_OPTIONS) && isset($TEMPLATE_OPTIONS['path_cache'])) {
+        CACHE_create_instance($cacheInstance, serialize($_TOPICS), true);
+    }
 } else {
     $_TOPICS = unserialize($serialized_topic_tree);
 }    



-- 
Erwan HAMON - http://hamon.erwan.free.fr/



More information about the geeklog-devel mailing list