about $validation.attributes

Author Message

Patrice DUCLAUD

Wednesday 10 January 2007 8:22:12 am

Hi all,

In a class, i've several attributes and in a form, i just want to allow update for 1 field (I don't want the others attributes appears in this form).

With an override of content/edit_attribute.tpl i look for the id of the attribute i want to update. Only this attribute appears and i can update it. When i validate the form, one of the other attributes of the class cause an error during the validation : "unknown error" is refered. In the class, all attributes have no restriction, no limitation.

$validation.attributes contains data of the attribute which cause problem (id, name of the field, error).

Where $validation.attributes used in content/edit_attribute.tpl, is updated during validation ?.

Is there à way to update partially one or several attributes of a class without difficulties with the others attributes ?

(ezpublish 3.6.10, php 4.3.)

help will be appreciated !

Patrice.

Claudia Kosny

Friday 12 January 2007 9:42:18 am

Hi Patrice

The last time I had such a problem this was caused by a small bug in one of the datatypes. If you are not afraid of changing a tiny bit of php code, determine the datatype of the attribute that is causing the problem and open the file /kernel/classes/datatypes/ez<name of datatype>/ez<name of datatype>type.php. There make sure that the function validateObjectAttributeHTTPInput returns EZ_INPUT_VALIDATOR_STATE_ACCEPTED if there is no input and $contentObjectAttribute->validateIsRequired() is false.

Alternatively you could write an extension which updates only the attributes of your choice (as this way you can circumvent the standard validation and instead use your own), but this requires much more PHP knowledge and a bit of insight into the internal workings of eZ.

Claudia

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.