summaryrefslogtreecommitdiff
path: root/inc/parserutils.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-02-08 22:27:33 +0100
committerAndreas Gohr <andi@splitbrain.org>2008-02-08 22:27:33 +0100
commit4892401568a6874c023b15f4392d087bebb2ad16 (patch)
tree9a6937379592501756acea4b116590160a603761 /inc/parserutils.php
parent8fdf940662349e4e96822926bf1e1668f654d112 (diff)
downloadrpg-4892401568a6874c023b15f4392d087bebb2ad16.tar.gz
rpg-4892401568a6874c023b15f4392d087bebb2ad16.tar.bz2
make sure $ID is set correct when rendering metadata
darcs-hash:20080208212733-7ad00-b111663f6397e220beac70b9f54bdffd0d8c2760.gz
Diffstat (limited to 'inc/parserutils.php')
-rw-r--r--inc/parserutils.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/inc/parserutils.php b/inc/parserutils.php
index d24417898..66d1ae13c 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -375,6 +375,11 @@ function p_read_metadata($id,$cache=false) {
* @author Esther Brunner <esther@kaffeehaus.ch>
*/
function p_render_metadata($id, $orig){
+ // make sure the correct ID is in global ID
+ global $ID;
+ $keep = $ID;
+ $ID = $id;
+
// add an extra key for the event - to tell event handlers the page whose metadata this is
$orig['page'] = $id;
@@ -385,7 +390,10 @@ 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
+ if(is_null($instructions)){
+ $ID = $keep;
+ return null; // something went wrong with the instructions
+ }
// set up the renderer
$renderer = & new Doku_Renderer_metadata();
@@ -402,6 +410,7 @@ function p_render_metadata($id, $orig){
}
$evt->advise_after();
+ $ID = $keep;
return $evt->result;
}
@@ -515,7 +524,7 @@ function p_sort_modes($a, $b){
* @author Harry Fuecks <hfuecks@gmail.com>
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function p_render($mode,$instructions,& $info){
+function p_render($mode,$instructions,&$info){
if(is_null($instructions)) return '';
// try default renderer first: