diff --git a/CHANGELOG.md b/CHANGELOG.md index 14daf67c..d77e506c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ * Added new `onAdminListContentEditors` event to add a custom editor to the list of available 1. [](#bugfix) * Use `Pages::find()` instead of `Pages::dispatch()` as we do not want to redirect out of admin - * Fixed broken `parent` field when using the old pages + * Fixed broken `parent` field when using the old pages + * Fixed broken `file` field preview when using streams in the path # v1.10.0-rc.11 ## 05/14/2020 diff --git a/themes/grav/templates/forms/fields/file/file.html.twig b/themes/grav/templates/forms/fields/file/file.html.twig index ccc3953c..f86f3b0f 100644 --- a/themes/grav/templates/forms/fields/file/file.html.twig +++ b/themes/grav/templates/forms/fields/file/file.html.twig @@ -35,7 +35,7 @@ {% set blueprint_name = type ~ '/' ~ blueprint_name %} {% endif %} {% set blueprint = base64_encode(blueprint_name) %} - {% set real_path = value.thumb ?? global.context.media[path].relativePath ?? global.form.getPagePathFromToken(path) ?? global.admin.getPagePathFromToken(path) %} + {% set real_path = (value.thumb ?? global.context.media[path].relativePath ?? global.form.getPagePathFromToken(path) ?? global.admin.getPagePathFromToken(path))|ltrim('/') %} {% set remove = global.file_task_remove ? global.file_url_remove : uri.addNonce( global.file_url_remove ~