Skip to content

Commit

Permalink
Merge pull request #1372 from ezsystems/EZP-27324-respect-media-versions
Browse files Browse the repository at this point in the history
EZP-27324: Proper media/binary uri is now shown & generated for old content versions
  • Loading branch information
ViniTou authored May 20, 2020
2 parents b6f8e3e + c6fa0ae commit c0b9d45
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,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, 'inLanguage': content.prioritizedFieldLanguageCode } ) %}
{% set route_reference = ez_route( 'ez_content_download', {
'content': content,
'fieldIdentifier': field.fieldDefIdentifier,
'inLanguage': content.prioritizedFieldLanguageCode,
'version': versionInfo.versionNo
} ) %}
{% set attr = attr|merge({'class': (attr.class|default('') ~ ' ez-field-preview ez-field-preview--ezbinaryfile')|trim}) %}
<div {{ block( 'field_attributes' ) }}>
<svg class="ez-icon ez-icon--file">
Expand All @@ -258,7 +263,11 @@
{% set attr = attr|merge({'class': (attr.class|default('') ~ ' ez-field-preview ez-field-preview--ezmedia')|trim}) %}
{% 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 hasController = value.hasController ? 'ezmedia.yes'|trans|desc('Yes') : 'ezmedia.no'|trans|desc('No') %}
{% set autoplay = value.autoplay ? 'ezmedia.yes'|trans|desc('Yes') : 'ezmedia.no'|trans|desc('No') %}
Expand Down

0 comments on commit c0b9d45

Please sign in to comment.