Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29558

URI attribute of ezbinaryfile is generated using URIElement of the first used Siteaccess

    XMLWordPrintable

    Details

      Description

      Steps to reproduce

      1. Install clean eZ Platform (1.7/1.13/2.x).
      2. Edit default Article ContentType and add the new field of type ezbinaryfile.
      3. Add new language, for instance Norwegian (nor-NO).
      4. Configure Siteaccesses as following:
            siteaccess:
                list: [nor, eng]
                groups:
                    site_group: [nor, eng]
                default_siteaccess: eng
                match:
                    URIElement: 1
            system:
                nor:
                    languages: [nor-NO]
                eng:
                    languages: [eng-GB]
        
      5. Create new article in eng-GB and attach file, for instance english.pdf.
      6. Translate content created in the previous step and attach new file, for instance norwegian.pdf.
      7. Create new frontend template and match it to handle Article ContentType:
        {% extends '@EzPublishCore/pagelayout.html.twig' %}
        {% block content %}
            {% set fileUri = ez_field_value(content, 'file').uri %}
            <a href="{{ fileUri }}">Download</a><br />
        {% endblock %}
        
      8. Open article on the frontend using nor siteaccess and check download link. You should see something like: example.com/nor/content/download/56/288.
      9. Open article on the frontend using eng siteaccess and check download link. You should see something like: example.com/nor/content/download/56/295.

      Actual behavior:
      ezbinaryfile uri property always contains the name of the siteaccess which has been used first.

      Expected behavior:
      ezbinaryfile uri should contain the name of the currently used siteaccess.

      Note:
      The issue isn't reproducible in v2, due to the fact how ContentProxy loads content, but still, cached uri might be invalid.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kamil.madejski@ez.no Kamil Madejski
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: