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

datatype eZSelection returns allways true in function hasObjectAttributeContent

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Customer request, 5.1
    • 4.7.0
    • Field types
    • None
    • Affects eZ Publish 4.x

    Description

      In kernel/classes/datatypes/ezselectionezselectiontype.php, hasObjectAttributeContent always returns true.
      Although this is correct for single choice eZSelection fields, it's not correct for multiple choice ones (where the user can publish content without any element selected).

      In order to verify, in a template, if the attribute truly has content, the code below can be used. But it would be cleaner if has_attribute returned false when on item had been selected.

      {if ne($node.data_map.ezselectionattribute.content[0], '')}
        {* has content *}
      {/if}
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            joaquim.cavalleri-obsolete@ez.no Joaquim Cavalleri (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
                5h