Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.3.0, 4.4.0, 4.5.0alpha
-
None
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.