Skip to content
Snippets Groups Projects
Commit 1af43c20 authored by Tim Schroeder's avatar Tim Schroeder
Browse files

Merge branch 'fix-warning-when-commenting-on-a-nonexistent-annotation' into 'testing'

fixed warning when commenting on a nonexistent annotation

See merge request moodle_l2p/moodle-mod_pdfannotator!174
parents f031c15e 432550ae
No related branches found
No related tags found
No related merge requests found
......@@ -350,7 +350,6 @@ if ($action === 'addComment') {
} else {
// Insert the comment into the mdl_pdfannotator_comments table and get its record id.
$comment = pdfannotator_comment::create($documentid, $annotationid, $extracted_content, $visibility, $isquestion, $cm, $context);
$commentid = $comment->uuid;
// If successful, create a comment array and return it as json.
if ($comment) {
......@@ -360,11 +359,7 @@ if ($action === 'addComment') {
echo json_encode($data);
} else {
if ($commentid == -1) {
echo json_encode(['status' => '-1']);
} else {
echo json_encode(['status' => 'error']);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment