Hi,
Importing created_on with a valid date, such as 2026-10-21 18:30:00, fails with parsererror. The issue occurs in administrator/components/com_csvi/helper/importfields.php, in convertDateToUtc():
$offset = $fieldDetails->offset === '' ? $templateOffset : $fieldDetails->offset;
When $fieldDetails has no offset property, this triggers an Undefined property warning and passes null to DateTimeZone, causing date conversion to fail. Warnings printed before the JSON response also cause parsererror. Suggested fix: handle the missing property and provide a default timezone:
$templateOffset = (string) ($this->template->get('offset', '') ?? '');
$templateOffset = $templateOffset === '' ? 'UTC' : $templateOffset;
$fieldOffset = (string) ($fieldDetails->offset ?? '');
$offset = $fieldOffset === '' ? $templateOffset : $fieldOffset;
After applying this fix, the import completes successfully and the date is saved correctly.
Environment reported in the log: RO CSVI 9.13.0, Joomla 6.2.0, PHP 8.5.11.
:)
best,
Chris
Hi Chris,
When $fieldDetails has no offset property, this triggers an Undefined property warning and passes null to DateTimeZone, causing date conversion to fail. Warnings printed before the JSON response also cause parsererror. Suggested fix: handle the missing property and provide a default timezone:
Thank you for posting the solution. Please tell me on which import operation you see this warning. Default timezone issue was fixed with RO CSVI 9.11.0 version so want to check why it happens again.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Hi Tharuna,
The issue occurs during Joomla content import, specifically when importing the created date field into the #__content table.
Unfortunately, the same bug is still present in the latest RO CSVI 9.14.0 release.
After updating, the import failed again with:
DateTimeZone::__construct(): Unknown or bad timezone ()
I restored my previous fix in:
administrator/components/com_csvi/helper/importfields.php
After applying the fix, the error disappeared and the import completed successfully.
You mentioned that the default timezone issue was fixed in version 9.11.0, but apparently the current code still does not handle a missing $fieldDetails->offset property correctly.
Could you please include this fix in the next official release? Otherwise, I have to restore my modification after every update.
Best regards,
Chris
Hi Chris,
Thank you for the fix. We have improved your fix a little more and have included it in our code. Fix will be included in upcoming RO CSVI release.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Log in to reply to this topic.