Skip to content

Commit

Permalink
EZP-27324: Proper media/binary uri is now shown & generated for old c…
Browse files Browse the repository at this point in the history
…ontent versions (#3033)
  • Loading branch information
ViniTou authored May 20, 2020
1 parent 80e801d commit 467f915
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@
{% block ezbinaryfile_field %}
{% apply spaceless %}
{% if not ez_is_field_empty( content, field ) %}
{% set route_reference = ez_route( 'ez_content_download', { 'content': content, 'fieldIdentifier': field.fieldDefIdentifier } ) %}
{% set route_reference = ez_route( 'ez_content_download', {
'content': content,
'fieldIdentifier': field.fieldDefIdentifier,
'inLanguage': content.prioritizedFieldLanguageCode,
'version': versionInfo.versionNo
} ) %}
<a href="{{ path( route_reference ) }}"
{{ block( 'field_attributes' ) }}>{{ field.value.fileName }}</a>&nbsp;({{ field.value.fileSize|ez_file_size( 1 ) }})
{% endif %}
Expand All @@ -219,7 +224,11 @@
{% apply spaceless %}
{% set type = fieldSettings.mediaType %}
{% set value = field.value %}
{% set route_reference = ez_route( 'ez_content_download', {'content': content, 'fieldIdentifier': field.fieldDefIdentifier} ) %}
{% set route_reference = ez_route( 'ez_content_download', {
'content': content,
'fieldIdentifier': field.fieldDefIdentifier,
'version': versionInfo.versionNo
} ) %}
{% set download = path( route_reference ) %}
{% set width = value.width > 0 ? 'width="' ~ value.width ~ '"' : "" %}
{% set height = value.height > 0 ? 'height="' ~ value.height ~ '"' : "" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function getStoragePathForField(Field $field, VersionInfo $versionInfo)
[
'contentId' => $versionInfo->contentInfo->id,
'fieldId' => $field->id,
'version' => $versionInfo->versionNo,
]
);
}
Expand Down

0 comments on commit 467f915

Please sign in to comment.