Mercurial > hg > extraction-interface
changeset 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 | c1bb174a22f3 |
files | config/config.php controllers/extractapp.php |
diffstat | 2 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/config/config.php Wed Nov 11 14:12:55 2015 +0100 +++ b/config/config.php Mon Nov 23 16:24:57 2015 +0100 @@ -14,7 +14,7 @@ global $AT_LOCAL, $mysql_database, $mysql_server, $mysql_user, $mysql_password, $server_host, $lgserver_url, $systemNAME, $system_root_url; - $AT_LOCAL = false; + $AT_LOCAL = true; if (!$AT_LOCAL) { // host at localgazetteers-dev server
--- 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']); }