# HG changeset patch # User Zoe Hong # Date 1448292297 -3600 # Node ID ce7e933b18b0f1bea70e0d663230094bb0cbff96 # Parent 9a29e9d28ece703e089ffc3da3d28f11e81364a8 bug fixed: new section with no fileId in LGServices when creating/changing to another topic diff -r 9a29e9d28ece -r ce7e933b18b0 config/config.php --- 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 diff -r 9a29e9d28ece -r ce7e933b18b0 controllers/extractapp.php --- 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
"; $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']); }