diff --git a/themes/grav/templates/forms/fields/file/file.html.twig b/themes/grav/templates/forms/fields/file/file.html.twig index 9bd42fe5..fa2f384f 100644 --- a/themes/grav/templates/forms/fields/file/file.html.twig +++ b/themes/grav/templates/forms/fields/file/file.html.twig @@ -37,18 +37,18 @@ {% set blueprint_name = type ~ '/' ~ blueprint_name %} {% set real_path = (value.thumb ?? global.context.media[path].relativePath ?? global.form.getPagePathFromToken(path) ?? global.admin.getPagePathFromToken(path))|ltrim('/') %} {% endif %} - {% set blueprint = base64_encode(blueprint_name) %} + {% set blueprint = blueprint_name|base64_encode %} {% set remove = global.file_task_remove ? global.file_url_remove : uri.addNonce( global.file_url_remove ~ '/media.json' ~ '/task' ~ config.system.param_sep ~ 'removeFileFromBlueprint' ~ - '/proute' ~ config.system.param_sep ~ base64_encode(route) ~ + '/proute' ~ config.system.param_sep ~ (route|base64_encode) ~ '/blueprint' ~ config.system.param_sep ~ blueprint ~ '/type' ~ config.system.param_sep ~ type ~ '/field' ~ config.system.param_sep ~ files.name ~ - '/path' ~ config.system.param_sep ~ base64_encode(value.path), 'admin-form', 'admin-nonce') %} + '/path' ~ config.system.param_sep ~ (value.path|base64_encode), 'admin-form', 'admin-nonce') %} {% set file = value|merge({remove: remove, path: value.thumb_url ?? (uri.rootUrl == '/' ? '/' : uri.rootUrl ~ '/' ~ real_path) }) %} diff --git a/themes/grav/templates/media-list-content.html.twig b/themes/grav/templates/media-list-content.html.twig index 74f4e162..b339dd1e 100644 --- a/themes/grav/templates/media-list-content.html.twig +++ b/themes/grav/templates/media-list-content.html.twig @@ -6,7 +6,7 @@ {% if the_file.exists and the_file.display() is not empty %}
- + {% set thumbnail = the_file.display(the_file.extension == 'svg' ? 'source' : 'thumbnail') %} {% if thumbnail %}