Skip to content

Commit

Permalink
pkp/pkp-lib#2163 Use full URLs in API _href entries
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr committed Oct 19, 2017
1 parent 159d171 commit 42fb1a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions classes/services/GalleyService.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public function getProperties($galley, $props, $args = null) {
$parentId = $galley->getIssueId();
}
if ($parentPath) {
$values[$prop] = sprintf(
'%s/api/%s/%s/%d',
$values[$prop] = $this->getAPIHref(
$args['request'],
$arguments['contextPath'],
$arguments['version'],
$parentPath,
Expand Down
9 changes: 7 additions & 2 deletions classes/services/IssueService.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ public function getProperties($issue, $props, $args = null) {
if (!empty($args['slimRequest'])) {
$route = $args['slimRequest']->getAttribute('route');
$arguments = $route->getArguments();
$href = "{$arguments['contextPath']}/api/{$arguments['version']}/issues/" . $issue->getId();
$values[$prop] = $href;
$values[$prop] = $this->getAPIHref(
$args['request'],
$arguments['contextPath'],
$arguments['version'],
'issues',
$issue->getId()
);
}
break;
case 'title':
Expand Down

0 comments on commit 42fb1a4

Please sign in to comment.