Mercurial > hg > extraction-interface
diff controllers/extractapp.php @ 96:ce7e933b18b0 extractapp
bug fixed: new section with no fileId in LGServices when creating/changing to another topic
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 23 Nov 2015 16:24:57 +0100 |
parents | 9a29e9d28ece |
children | 5bea390e7ca9 |
line wrap: on
line diff
--- a/controllers/extractapp.php Wed Nov 11 14:12:55 2015 +0100 +++ b/controllers/extractapp.php Mon Nov 23 16:24:57 2015 +0100 @@ -102,7 +102,14 @@ case 'ContinueTagging': $viewmodel->messages['info'] .= "(Countinue tagging) "; $viewmodel->SetInfoFromPreviousPage($this->postdata); - $viewmodel->SetTextFromFileId(); // get text by fileId, from LGService + + // when new section hasn't been saved to LGServices, no fileId and no branchId + if ($this->postdata['fileId'] == 0) { + $viewmodel->SetTextFromSectionId(); + } else { + $viewmodel->SetTextFromFileId(); // get text by fileId, from LGService + } + $viewmodel->SetTopic($this->postdata['topic']); $this->ReturnView($viewmodel->StartTagging(), true); @@ -116,7 +123,13 @@ // then act like ContinueTagging $viewmodel->messages['info'] .= "Created a new topic <br>"; $viewmodel->SetInfoFromPreviousPage($result); - $viewmodel->SetTextFromFileId(); // get text by fileId, from LGService + + // when new section hasn't been saved to LGServices, no fileId and no branchId + if ($this->postdata['fileId'] == 0) { + $viewmodel->SetTextFromSectionId(); + } else { + $viewmodel->SetTextFromFileId(); // get text by fileId, from LGService + } $viewmodel->SetTopic($result['topic']); }