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.

eZ debug

Timing: Jan 18 2025 19:21:34
Script start
Timing: Jan 18 2025 19:21:34
Module start 'layout'
Timing: Jan 18 2025 19:21:34
Module start 'content'
Timing: Jan 18 2025 19:21:35
Module end 'content'
Timing: Jan 18 2025 19:21:35
Script end

Main resources:

Total runtime0.8163 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.9063152.6250
Module start 'layout' 0.00510.0034 742.531339.4453
Module start 'content' 0.00860.8062 781.9766457.9688
Module end 'content' 0.81470.0015 1,239.94538.1641
Script end 0.8162  1,248.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3728160.0002
Check MTime0.00130.1617160.0001
Mysql Total
Database connection0.00120.145810.0012
Mysqli_queries0.776395.0999540.0144
Looping result0.00050.0585520.0000
Template Total0.782495.820.3912
Template load0.00220.274320.0011
Template processing0.780195.571820.3901
Template load and register function0.00010.017810.0001
states
state_id_array0.00100.125110.0010
state_identifier_array0.00140.167820.0007
Override
Cache load0.00180.2168170.0001
Sytem overhead
Fetch class attribute can translate value0.00100.121920.0005
Fetch class attribute name0.00150.180420.0007
XML
Image XML parsing0.00020.028020.0001
class_abstraction
Instantiating content class attribute0.00000.000820.0000
General
dbfile0.00080.1002100.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 4

Time used to render debug report: 0.0001 secs