From 474953daa5b4d5f31a252495b55523cd8e77b897 Mon Sep 17 00:00:00 2001 From: Ian Date: Sat, 21 Sep 2013 14:30:53 +0200 Subject: [PATCH] try to fix - draft preview non-object error Draft previews threw: Fatal error: Call to a member function assignByRef() on a non-object in /fullpath/include/functions_entries.inc.php on line 1235, which is the $serendipity['smarty']->assignByRef('entries', $dategroup); line. Please double check if that is gone now. --- include/functions_entries.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index 094e203c..dee36e88 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -1027,6 +1027,10 @@ function serendipity_getTotalEntries() { function serendipity_printEntries($entries, $extended = 0, $preview = false, $smarty_block = 'ENTRIES', $smarty_fetch = true, $use_hooks = true, $use_footer = true, $use_grouped_array = false) { global $serendipity; + if (!is_object($serendipity['smarty'])) { + serendipity_smarty_init(); // if not set, start Smarty templating to avoid member function "method()" on a non-object errors (was draft preview error, now at line 1239) + } + if ($use_hooks) { $addData = array('extended' => $extended, 'preview' => $preview); serendipity_plugin_api::hook_event('entry_display', $entries, $addData); @@ -1491,7 +1495,7 @@ function serendipity_deleteEntry($id) { * @param string The character to use for blank indenting * @see serendipity_fetchCategories() */ -function serendipity_generateCategoryList($cats, $select = array(0), $type = 0, $id = 0, $level = 0, $xmlImg = '', $blank_char = ' ') { +function serendipity_generateCategoryList($cats, $select = array(0), $type = 0, $id = 0, $level = 0, $xmlImg = '', $blank_char = ' ') { global $serendipity; if ( !is_array($cats) || !count($cats) )