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

eZKeywordType::fromString() not working with an empty value

    XMLWordPrintable

    Details

      Description

      As reported on community forums [1], the fromString method for eZKeyword datatype doesn't do anything when an empty string is given.

      There is a specifik condition in the method definition [2] to avoid updating in this case.

      I think this is a bug because I think it's normal to assume that a "fromString" method is going to empty its attribute, if an empty value is given.

      I don't get what this check for empty string is for :
      I tried to remove this limitation and everything seems to tun fine, ezkeyword and ezkeyword_attribute_link are updated on store, and my contentobject look up to date through the admin interface.

      [1] http://share.ez.no/forums/developer/empty-an-ezkeyword-field-in-php
      [2] http://pubsvn.ez.no/doxygen/trunk/html/ezkeywordtype_8php_source.html#l00277

      Steps to reproduce

      Through admin interface :
      Create a contentclass with an ezkeyword attribute
      Create an object instance of this contentclass and fill the ezkeyword attribute with at least one value.

      Create a php script in ez context wich :
      Fetches the object
      Update the keyword attribute with the fromString method and try giving an empty value.
      Empty cache
      Go back to admin interface and see you object has still the original value in the keyword attribute.

        Attachments

          Activity

            People

            Assignee:
            andre1 André R
            Reporter:
            huge Hugues Charleux
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: