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

Embedded content is still displayed after it is moved to trash

    XMLWordPrintable

Details

    Description

      If the Content Object (eg. File) is embedded using Rich Text Field into another Content Object (eg. Folder) and the former is deleted (moved to trash), then displaying the Folder Content Object in the front-office should not include the deleted File Content Object. This is the legacy behaviour (which can be tested in the fresh installation by skipping steps 2 and 3 from the steps to reproduce below). However, if ez_render_field is used, then the deleted Content Object is still shown. The link generated for it is not working/not correct (depending on the embedded Content Type).

      There is a similar problem in the eZ Platform, but since steps to reproduce are a little different and the end result is also different, I have separated the issues. The one regarding eZ Platform can be found here: EZP-28123.

      Steps to reproduce

      1. Create new eZ Publish 5.4 installation.
      2. Add the following configuration to ezpublish/config/ezpublish.yml:
        ezpublish:
            system:
                ezdemo_site_clean_group:
                    location_view:
                        full:
                            folder:
                                template: "AppBundle:full:folder.html.twig"
                                match:
                                    Identifier\ContentType: folder
        
      3. Create AppBundle, register it and create Resources/views/full/folder.html.twig file there:
        {% extends noLayout ? viewbaseLayout : "eZDemoBundle::pagelayout.html.twig" %}
        
        {% block content %}
                {% block description %}
                    {% if not ez_is_field_empty( content, 'description' ) %}
                        {{ ez_render_field( content, 'description' ) }}
                    {% endif %}
                {% endblock %}
        {% endblock %}
        

        Alternatively, use the AppBundle provided as an attachment to this issue.

      4. In the back-office, create new Folder Content Type under "Home" named "Test Folder".
      5. In the Media/Files, create new File Content Type named "Test File".
      6. Edit the "Test Folder". In the "Description" field, embed the "Test file" using the "Insert/edit object" button from the Rich Text Editor. Publish "Test Folder".
      7. In the front-office, navigate to "/Test-Folder". Confirm that the embedded Content Object "Test file" is also displayed.
      8. In the backoffice, navigate to "Media/Files/Test file" and remove it by sending it to trash.
      9. In the front-office, navigate to "/Test-Folder" again. Notice that the embedded Content Object "Test file" is also displayed, despite being in the trash.


      Best regards,
      Jacek Foremski
      Product Support Engineer


      eZ Platform Enterprise Edition v1.11 is now available, Easier to Build a Solid Content Business
      http://ez.no/Products/eZ-Platform-Enterprise-Edition

      Attachments

        1. AppBundle.zip
          0.9 kB
        2. ezp-27396.patch
          5 kB
        3. ezp-28122.patch
          8 kB

        Activity

          People

            Unassigned Unassigned
            jacek.foremski-obsolete@ez.no Jacek Foremski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: