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.