Merge pull request #2423 from splitbrain/fixDraftException

🐛 (Draft) Fix exception when actually viewing a draft of a page
This commit is contained in:
Andreas Gohr 2018-06-15 10:23:53 +02:00 committed by GitHub
commit e954c8851f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -152,4 +152,14 @@ class Draft
{
return $this->errors;
}
/**
* Get the timestamp when this draft was saved
*
* @return int
*/
public function getDraftDate()
{
return filemtime($this->cname);
}
}

View File

@ -314,10 +314,10 @@ function html_draft(){
html_diff($text, false);
$form = new Doku_Form(array('id' => 'dw__editform'));
$form->addHidden('id', $ID);
$form->addHidden('date', $draft['date']);
$form->addHidden('date', $draft->getDraftDate());
$form->addHidden('wikitext', $text);
$form->addElement(form_makeOpenTag('div', array('id'=>'draft__status')));
$form->addElement($lang['draftdate'].' '. dformat(filemtime($INFO['draft'])));
$form->addElement($draft->getDraftMessage());
$form->addElement(form_makeCloseTag('div'));
$form->addElement(form_makeButton('submit', 'recover', $lang['btn_recover'], array('tabindex'=>'1')));
$form->addElement(form_makeButton('submit', 'draftdel', $lang['btn_draftdel'], array('tabindex'=>'2')));