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

ez_is_field_empty broken on Object Relation fields

    XMLWordPrintable

Details

    Description

      If "internal_link" is an Object Relation field, and you use this in your Twig template:

      {% if ez_is_field_empty( content, 'internal_link' ) %}
      

      This works before the field has content. However, it breaks if the field had content and then the content was removed.

      Steps to reproduce:

      1. Create a class that contains an attribute of type "Object Relation";
      2. Create an object for the new class, but leave the "Object Relation" field empty;
      3. On a test Twig template, use ez_is_field_empty() to check the above field. It will return "true", as expected;
      4. Edit the object and now link the "Object Relation" field to an existing content. ez_is_field_empty() will return "false", as expected;
      5. Now clear the "Object Relation" field. ez_is_field_empty() will return "false", which is wrong. The field is now empty, so it should return "true".

      Attachments

        Activity

          People

            Unassigned Unassigned
            nuno.oliveira-obsolete@ez.no Nuno Oliveira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 20 minutes
                5h 20m