Skip to content

Commit

Permalink
Use relative paths for previews to support sites in sub dirs
Browse files Browse the repository at this point in the history
The use of an absolute path caused the dataobject previewer iframe to
point to an incorrect path when a site was not located directly in the
document root. A 404 page would display in all preview iframes instead
of the preview that had been rendered.
  • Loading branch information
stecman committed Nov 12, 2015
1 parent e287afe commit a8f258c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/DataObjectPreviewer.php
Expand Up @@ -30,7 +30,7 @@ public function preview(DataObjectPreviewInterface $record)

return sprintf(
'<div class="dataobjectpreview" data-src="%s"></div>',
str_replace(BASE_PATH, '', $htmlFilepath)
str_replace(BASE_PATH . '/', '', $htmlFilepath)
);
}
}

0 comments on commit a8f258c

Please sign in to comment.