MDL-49864 mod_assign: Fix missing annotations when viewing PDF

Added 'draft = 1' criteria for the delete query in
page_editor::set_annotations in order to prevent the deletion of non-draft
annotations while the PDF is being edited.
This commit is contained in:
Jun Pataleta 2015-07-28 17:16:32 +08:00
parent 032a4fe51c
commit 0bf75ff15f

View File

@ -159,7 +159,7 @@ class page_editor {
public static function set_annotations($gradeid, $pageno, $annotations) {
global $DB;
$DB->delete_records('assignfeedback_editpdf_annot', array('gradeid'=>$gradeid, 'pageno'=>$pageno));
$DB->delete_records('assignfeedback_editpdf_annot', array('gradeid' => $gradeid, 'pageno' => $pageno, 'draft' => 1));
$added = 0;
foreach ($annotations as $record) {
// Force these.