/*!
Validates the input and returns true if the input was
valid for this datatype.
*/
function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
{
if ( $http->hasPostVariable( $base . '_data_text_' . $contentObjectAttribute->attribute( 'id' ) ) )
{
$email = $http->postVariable( $base . '_data_text_' . $contentObjectAttribute->attribute( 'id' ) );
$classAttribute = $contentObjectAttribute->contentClassAttribute();
$trimmedEmail = trim( $email );
if ( $trimmedEmail == "" )
{
// we require user to enter an address only if the attribute is not an informationcollector
if ( !$classAttribute->attribute( 'is_information_collector' ) and
$contentObjectAttribute->validateIsRequired() )
{
$contentObjectAttribute->setValidationError( ezi18n( 'kernel/classes/datatypes',
'The email address is empty.' ) );
return eZInputValidator::STATE_INVALID;
}
}
else
{
// if the entered address is not empty then we should validate it in any case
return $this->validateEMailHTTPInput( $trimmedEmail, $contentObjectAttribute );
}
}
else if ( !$classAttribute->attribute( 'is_information_collector' ) and $contentObjectAttribute->validateIsRequired() )
{
$contentObjectAttribute->setValidationError( ezi18n( 'kernel/classes/datatypes', 'Missing email input.' ) );
return eZInputValidator::STATE_INVALID;
}
return eZInputValidator::STATE_ACCEPTED;
}
Your form is probably missing a required attribute (not just that someone didn't fill it in, but it's not even being posted as empty). Make sure that all necessary form fields are present, and that they are named correctly. To do this, you can double-check with how all fields would be named if they were output using attribute_view_gui.