Skip to content
Snippets Groups Projects
Unverified Commit 432550ae authored by Tim Schroeder's avatar Tim Schroeder
Browse files

fixed warning when commenting on a nonexistent annotation

parent f031c15e
No related branches found
No related tags found
No related merge requests found
...@@ -350,7 +350,6 @@ if ($action === 'addComment') { ...@@ -350,7 +350,6 @@ if ($action === 'addComment') {
} else { } else {
// Insert the comment into the mdl_pdfannotator_comments table and get its record id. // 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); $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 successful, create a comment array and return it as json.
if ($comment) { if ($comment) {
...@@ -360,11 +359,7 @@ if ($action === 'addComment') { ...@@ -360,11 +359,7 @@ if ($action === 'addComment') {
echo json_encode($data); echo json_encode($data);
} else { } else {
if ($commentid == -1) {
echo json_encode(['status' => '-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