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

datatype eZSelection returns allways true in function hasObjectAttributeContent

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Fixed
    • Affects Version/s: 4.7.0
    • Fix Version/s: Customer request, 5.1
    • Component/s: Field types
    • Labels:
      None
    • Environment:

      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}
      

        Activity

        Joaquim Cavalleri (Inactive) created issue -
        Joaquim Cavalleri (Inactive) made changes -
        Field Original Value New Value
        Status Open [ 1 ] Backlog [ 10000 ]
        Joaquim Cavalleri (Inactive) made changes -
        Labels support wit
        Fix Version/s Customer request [ 11018 ]
        Bertrand Dunogier made changes -
        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.
        {code}
        {if ne($node.data_map.ezselectionattribute.content[0], '')}
          {* has content *}
        {/if}
        {code}
        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.
        {code}
        {if ne($node.data_map.ezselectionattribute.content[0], '')}
          {* has content *}
        {/if}
        {code}
        Jostein Knudsen (Inactive) made changes -
        Status Backlog [ 10000 ] InputQ [ 10001 ]
        Paul Borgermans (Inactive) made changes -
        Assignee Paul Borgermans [ paul.borgermans@ez.no ]
        Paul Borgermans (Inactive) made changes -
        Status InputQ [ 10001 ] Development [ 3 ]
        Paul Borgermans (Inactive) made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 3 hours [ 10800 ]
        Worklog Id 24198 [ 24198 ]
        Paul Borgermans (Inactive) made changes -
        Status Development [ 3 ] Development review [ 10006 ]
        Paul Borgermans (Inactive) made changes -
        Rank Ranked higher
        André Rømcke made changes -
        Workflow eZ Community Workflow [ 34210 ] eZ Engineering Scrumban Workflow [ 35940 ]
        Paul Borgermans (Inactive) made changes -
        Time Spent 3 hours [ 10800 ] 3 hours, 30 minutes [ 12600 ]
        Worklog Id 25074 [ 25074 ]
        Paul Borgermans (Inactive) made changes -
        Status Development review [ 10006 ] Development Review done [ 10028 ]
        André Rømcke made changes -
        Status Development Review done [ 10028 ] Development Acceptance Done [ 10030 ]
        André Rømcke made changes -
        Assignee Paul Borgermans [ paul.borgermans@ez.no ]
        Status Development Acceptance Done [ 10030 ] Closed [ 6 ]
        Fix Version/s 5.1 [ 11280 ]
        Resolution Fixed [ 1 ]
        Paul Borgermans (Inactive) made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Paul Borgermans (Inactive) made changes -
        Time Spent 3 hours, 30 minutes [ 12600 ] 5 hours [ 18000 ]
        Worklog Id 25074 [ 25074 ]
        Paul Borgermans (Inactive) made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        André Rømcke made changes -
        Workflow eZ Engineering Scrumban Workflow [ 35940 ] EZ* Development Workflow [ 83164 ]
        Alex Schuster made changes -
        Workflow EZ* Development Workflow [ 83164 ] EZEE Development Workflow [ 121744 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            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