Share » Forums » Developer » New datatype not storing content

New datatype not storing content

New datatype not storing content

Tuesday 13 January 2004 5:45:41 am - 5 replies

Author Message

Hans Melis

Tuesday 13 January 2004 8:19:17 am

Hi Eirik,

Have you implemented the function storeObjectAttribute() in your datatype? Even an empty implementation seems to do the trick according to the eztext datatype, but there are other ways as well.

/*!
Store the content.
*/
function storeObjectAttribute( &$attribute )
{
}

hth

--
Hans

Hans
http://blog.hansmelis.be

Eirik Alfstad Johansen

Tuesday 13 January 2004 10:15:05 am

Hi Hans,

Yes, I have, so that can't be it. Any other ideas?

Thanks in advance !

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Eirik Alfstad Johansen

Friday 16 January 2004 6:10:23 am

Hi Hans,

In your previous post you mentioned that "there are other ways as well". What other ways were you referring to, as I still can't get this to work. BTW, here's the mothod which should store the datatype value.

function fetchObjectAttributeHTTPInput( &$http, $base, &$contentObjectAttribute )
{
if ( $http->hasPostVariable( $base . "_data_text_" .
$contentObjectAttribute->attribute( "id" ) ) )
{
$data =& $http->postVariable( $base . "_data_text_" .
$contentObjectAttribute->attribute( "id" )
);

$contentObjectAttribute->setAttribute( "data_text", $data );
}

return false;
}

Any insight is greatly appreciated !

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Hans Melis

Friday 16 January 2004 7:45:51 am

Eirik,

The method we usually use in datatypes uses the content(). Example:

function fetchObjectAttributeHTTPInput( &$http, $base, &$contentObjectAttribute )
{
if ( $http->hasPostVariable( $base . "_data_text_" .
$contentObjectAttribute->attribute( "id" ) ) )
{
$data =& $http->postVariable( $base . "_data_text_" .
$contentObjectAttribute->attribute( "id" )
);

$contentObjectAttribute->setContent( $data );
return true;
}

return false;
}

and then:

function storeObjectAttribute( &$attribute )
{
$data = $attribute->content();
$attribute->setAttribute('data_text', $date);
}

But I just spotted something. In your fetchHTTPinput function, you don't do a "return true;" when you've done setAttribute(). Maybe that has something to do with it.

--
Hans

Hans
http://blog.hansmelis.be

Eirik Alfstad Johansen

Friday 16 January 2004 10:03:57 am

Hi Hans,

> But I just spotted something. In your fetchHTTPinput function,
> you don't do a "return true;" when you've done setAttribute().
> Maybe that has something to do with it.

That was it! Thanks a million, Hans!

- Eirik

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu