From 3b3f8916a9e666028ebc10723d6bea99de1342cc Mon Sep 17 00:00:00 2001 From: Andreas Gohr <andi@splitbrain.org> Date: Sun, 28 Jan 2007 12:39:52 +0100 Subject: [PATCH] small fix for metadata rendering if instructions aren't available darcs-hash:20070128113952-7ad00-e7293a11680aed2cd88aac49d2a8b612bd0e61ee.gz --- inc/parserutils.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/inc/parserutils.php b/inc/parserutils.php index 68ccd3231..57a0c68ca 100644 --- a/inc/parserutils.php +++ b/inc/parserutils.php @@ -185,7 +185,7 @@ function p_cached_instructions($file,$cacheonly=false,$id='') { return $ins; } - return NULL; + return null; } /** @@ -277,7 +277,7 @@ function p_set_metadata($id, $data, $render=false, $persistent=true){ foreach ($value as $subkey => $subvalue){ $meta['current'][$key][$subkey] = array_merge($meta['current'][$key][$subkey], $subvalue); - if ($persistent) + if ($persistent) $meta['persistent'][$key][$subkey] = array_merge($meta['persistent'][$key][$subkey], $subvalue); } @@ -307,7 +307,7 @@ function p_set_metadata($id, $data, $render=false, $persistent=true){ // sync cached copies, including $INFO metadata global $cache_metadata, $INFO; - + if (!empty($cache_metadata[$id])) $cache_metadata[$id] = $meta; if (!empty($INFO) && ($id == $INFO['id'])) { $INFO['meta'] = $meta['current']; } @@ -372,7 +372,7 @@ function p_read_metadata($id,$cache=false) { function p_render_metadata($id, $orig){ // add an extra key for the event - to tell event handlers the page whose metadata this is - $orig['page'] = $id; + $orig['page'] = $id; $evt = new Doku_Event('PARSER_METADATA_RENDER', $orig); if ($evt->advise_before()) { @@ -380,6 +380,7 @@ function p_render_metadata($id, $orig){ // get instructions $instructions = p_cached_instructions(wikiFN($id),false,$id); + if(is_null($instructions)) return null; // something went wrong with the instructions // set up the renderer $renderer = & new Doku_Renderer_metadata(); @@ -560,7 +561,7 @@ function p_render($mode,$instructions,& $info){ * * @param string $id dokuwiki page id * @param bool $render rerender if first heading not known - * default: false -- this protects against loops where $id requires a + * default: false -- this protects against loops where $id requires a * first heading further pages which eventually result * in a request for a first heading from a page already * in the chain (FS#1010) -- GitLab