Description
Hello,
Version : 6.9@dev
Since a last composer update, when I update a node with an empty row date I have this error :
<?xml version="1.0" encoding="UTF-8"?>
<ErrorMessage media-type="application/vnd.ez.api.ErrorMessage+xml">
<errorCode>500</errorCode>
<errorMessage>Internal Server Error</errorMessage>
<errorDescription>
DateTime::__construct(): Failed to parse time string (@) at position 0 (@): Unexpected character
</errorDescription></ErrorMessage
I have this in the logs :
request.CRITICAL: Uncaught PHP Exception Exception:
"DateTime::__construct(): Failed to parse time string (@) at position 0 (@): Unexpected character"
at
/var/www/ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/Date/SearchField.php line 32
[]
I have patch the vendor like this for correct the problem :
public function getIndexData(Field $field, FieldDefinition $fieldDefinition)
{
//@patch add this if
if($field->value->data['timestamp']!=""){
$dateTime = new DateTime("@{$field->value->data['timestamp']}");
return array(
new Search\Field(
'value',
$dateTime->format('Y-m-d
Z'),
new Search\FieldType\DateField()
),
);
}
}
Best regards,
Alexandre
Attachments
Issue Links
- is duplicated by
-
EZP-27281 Fix BC on Date FieldType indexing
- Closed