Skip to content

Commit

Permalink
#16263 fix to use the current host when there is not a host in the co…
Browse files Browse the repository at this point in the history
…ntainer id as a path
  • Loading branch information
jdotcms committed Apr 10, 2019
1 parent 0da60cf commit 235b046
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -125,7 +125,7 @@ public String getHostName (final String path) {
public String getContainerIdFromPath(final String fullPath) throws DotDataException {

Host host = null;
final String hostname = this.getHostName(fullPath);
String hostname = this.getHostName(fullPath);

try {
if (null != hostname) {
Expand All @@ -144,8 +144,13 @@ public String getContainerIdFromPath(final String fullPath) throws DotDataExcept
}
}

if (null == hostname) {

hostname = null != host?host.getHostname():StringPool.BLANK;
}

final String relativePath = this.getPathFromFullPath (hostname, fullPath);
final String containerUri = (relativePath.endsWith(FORWARD_SLASH)?relativePath:relativePath+FORWARD_SLASH)+"container.vtl";
final String containerUri = (relativePath.endsWith(FORWARD_SLASH)? relativePath:relativePath+FORWARD_SLASH)+"container.vtl";

final Identifier identifier = APILocator.getIdentifierAPI().find(host, containerUri);
return identifier.getId();
Expand Down

0 comments on commit 235b046

Please sign in to comment.