2009-02-13
abompard
Since version RC2009-02-06, the renderer plugin can't change the metadata (such as Content-Type) before the page is output. Once it has been run for the first time, the metadata are cached and it works fine.
I did not have this bug with version 2008-05-05.
I found out where this comes from: in the inc/action.php file, around line 478:
<code>
default:
$headers = p_get_metadata($ID,"format $mode");
$output = p_cached_output(wikiFN($ID,$REV), $mode);
break;
</code>
Since the headers are retrieved before the output, the p_set_metadata() call which was in the document_start function of the renderer is called after the p_get_metadata here, and thus the headers are empty.
This happens with the odt plugin here. To verify it, remove the cache and the metadata cache in the data/meta dir, and try to export a page.
Is there another way to set the metadata, which would be run before the code above in the action.php file ? If not, the headers should be retrieved after the output (I tried reversing the two lines above and it fixes this bug, but I don't know if it breaks anything else)