Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jkim01 committed Feb 21, 2019
1 parent 03f2a9d commit 7cd71f0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions classes/AlgoliaService.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ function mapAlgoliaFieldsToIndex($article){
}

function formatUrl($article, $custom = false){
$baseUrl = Config::getVar('general', 'base_url');

$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticle = $publishedArticleDao->getByArticleId($article->getId());
$sequence = $publishedArticle->getSequence();
Expand All @@ -428,14 +430,10 @@ function formatUrl($article, $custom = false){
$acronym = $journal->getLocalizedAcronym();

if(!$custom){
return Config::getVar('general', 'base_url') . "/" . $acronym . "/view/" . $article->getId();
return $baseUrl . "/" . $acronym . "/view/" . $article->getId();
}else{
// for example:
// return "/" . $acronym . "/view/" . $acronym . $volume . "." . $number . "." . str_pad($number, 2, "0", STR_PAD_LEFT);

return Config::getVar('general', 'base_url') . "/" . $acronym . "/view/" . $article->getId();
return $baseUrl . "/" . $acronym . "/view/" . $acronym . $volume . "." . $number . "." . str_pad($number, 2, "0", STR_PAD_LEFT);
}

}

function getAuthors($article){
Expand Down

0 comments on commit 7cd71f0

Please sign in to comment.