Skip to content

Commit

Permalink
fix approve header for non-existing pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Szymon Olewniczak committed Oct 23, 2018
1 parent 99eaf3e commit 13f545d
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions action/prettyprint.php
Expand Up @@ -32,20 +32,23 @@ function _printingInfo(Doku_Event $event, $param) {
if ($this->getConf('prettyprint')) {
$JSINFO['approve']['prettyprint'] = true;

$versions = p_get_metadata($ID, ApproveConst::METADATA_VERSIONS_KEY);
if ($versions) {
if(empty($REV)) {
$version = $versions[0];
} else {
$version = $versions[$REV];
//generate approve info only for existing pages
if (page_exists($ID)) {
$versions = p_get_metadata($ID, ApproveConst::METADATA_VERSIONS_KEY);
if ($versions) {
if(empty($REV)) {
$version = $versions[0];
} else {
$version = $versions[$REV];
}
$JSINFO['approve']['version'] = $version;
}
$JSINFO['approve']['version'] = $version;
}

$page_sum = $this->hlp->page_sum($ID, $REV);
$JSINFO['approve']['status'] = $page_sum;
$JSINFO['approve']['date'] = dformat($INFO['lastmod']);
$JSINFO['approve']['author'] = editorinfo($INFO['editor']);
$page_sum = $this->hlp->page_sum($ID, $REV);
$JSINFO['approve']['status'] = $page_sum;
$JSINFO['approve']['date'] = dformat($INFO['lastmod']);
$JSINFO['approve']['author'] = editorinfo($INFO['editor']);
}
} else {
$JSINFO['approve']['prettyprint'] = false;
}
Expand Down

0 comments on commit 13f545d

Please sign in to comment.