Problems with a custom datatype

Author Message

David Zaoui

Monday 25 June 2007 5:05:46 am

Hi,

I'm experiencing a little problem with a custom datatype that i wanted to created. This datatype is similar to the "author" one, but without the "e-mail field".
I created an extension and everything seems to works fine, except the storage of the "name" field of the datatype : when i want to add a new element (the same way than the ezauthor datatype) , a new field is displayed, but the previous ones don't display anything ( they should display the name of the element.
Here's a portion of the code that i use :

Template :

{* Name. *}
<td>
<input id="ezcoa-{if ne( $attribute_base, 'ContentObjectAttribute' )}{$attribute_base}-{/if}{$attribute.contentclassattribute_id}_{$attribute.contentclass_attribute_identifier}_name_{$Agence:index}" class="box ezcc-{$attribute.object.content_class.identifier} ezcca-{$attribute.object.content_class.identifier}_{$attribute.contentclass_attribute_identifier}" type="text" name="{$attribute_base}_data_agence_name_{$attribute.id}[]" value="{$Agence:item.name|wash}" />
<input type="hidden" name="{$attribute_base}_data_agence_id_{$attribute.id}[]" value="{$Agence:item.id}" />
</td>

php file :

function validateObjectAttributeHTTPInput( &$http, $base, &$contentObjectAttribute )
{
...
if ( $http->hasPostVariable( $base . '_data_agence_id_' . $contentObjectAttribute->attribute( "id" ) ) )

{
$classAttribute =& $contentObjectAttribute->contentClassAttribute();
$idList = $http->postVariable( $base . "_data_agence_id_" . $contentObjectAttribute->attribute( "id" ) );
$nameList = $http->postVariable( $base . "_data_agence_name_" . $contentObjectAttribute->attribute( "id" ) );
....
}

The nameList array seems to remain empty.

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 31 2025 03:32:21
Script start
Timing: Jan 31 2025 03:32:21
Module start 'layout'
Timing: Jan 31 2025 03:32:21
Module start 'content'
Timing: Jan 31 2025 03:32:21
Module end 'content'
Timing: Jan 31 2025 03:32:21
Script end

Main resources:

Total runtime0.0223 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.1328151.2109
Module start 'layout' 0.00540.0036 739.3438220.6875
Module start 'content' 0.00900.0119 960.0313997.6797
Module end 'content' 0.02090.0013 1,957.710929.9922
Script end 0.0222  1,987.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002712.0324140.0002
Check MTime0.00104.5388140.0001
Mysql Total
Database connection0.00093.989410.0009
Mysqli_queries0.002310.534130.0008
Looping result0.00000.049310.0000
Template Total0.00104.310.0010
Template load0.00083.463510.0008
Template processing0.00020.839610.0002
Override
Cache load0.00062.532910.0006
General
dbfile0.00094.223980.0001
String conversion0.00000.045040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs