By Phrixos on Thursday, 18 August 2022
Replies 14
Likes 0
Views 1.1K
Votes 0
If you add a event bevor 1902 you get a SQL-Errorstatment!
An error has occurred.

0 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1864-11-01 20:00:00','1864-11-01 23:59:59','05309848b13f4708ac7eaecc2eec817e')' at line 2

We also manage historical events!
What version of MySQL or MariaDB do you have?

We use DATETIME as our storage format and that should allow a very wide range of dates (https://dev.mysql.com/doc/refman/5.7/en/datetime.html)
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I've managed to recreate the problem and the issue is with out of date integer fields for the unix timestamp equivalent of the date field.

This version of JEvents should resolve it
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Your Attachmend installed

Bad new news:

New Error:
PROBLEMS_STORING_EVENT<br>There were problems saving the event detailProblem saving event Exception: Problem saving event Out of range value for column 'dtstart' at row 1 in /home/www/test/components/com_jevents/libraries/iCalEventDetail.php:296 Stack trace: #0 /home/www/test/components/com_jevents/libraries/iCalEvent.php(295): iCalEventDetail->store(false) #1 /home/www/test/administrator/components/com_jevents/libraries/saveIcalEvent.php(231): iCalEvent->store() #2 /home/www/test/administrator/components/com_jevents/controllers/icalevent.php(952): SaveIcalEvent::save(Array, Object(JEventsDBModel), Array) #3 /home/www/test/administrator/components/com_jevents/controllers/icalevent.php(737): AdminIcaleventController->doSave('') #4 /home/www/test/libraries/src/MVC/Controller/BaseController.php(735): AdminIcaleventController->save() #5 /home/www/test/administrator/components/com_jevents/jevents.php(268): Joomla\CMS\MVC\Controller\BaseController->execute('save') #6 /home/www/test/libraries/src/Dispatcher/LegacyComponentDispatcher.php(69): require_once('/home/www/test/...') #7 /home/www/test/libraries/src/Dispatcher/LegacyComponentDispatcher.php(71): Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}('/home/www/test/...') #8 /home/www/test/libraries/src/Component/ComponentHelper.php(389): Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() #9 /home/www/test/libraries/src/Application/AdministratorApplication.php(143): Joomla\CMS\Component\ComponentHelper::renderComponent('com_jevents') #10 /home/www/test/libraries/src/Application/AdministratorApplication.php(186): Joomla\CMS\Application\AdministratorApplication->dispatch() #11 /home/www/test/libraries/src/Application/CMSApplication.php(278): Joomla\CMS\Application\AdministratorApplication->doExecute() #12 /home/www/test/administrator/includes/app.php(63): Joomla\CMS\Application\CMSApplication->execute() #13 /home/www/test/administrator/index.php(32): require_once('/home/www/test/...') #14 {main}

Additional informations:
Database Type mysql
Database Version 5.7.38

Joomla! Version Joomla! 4.1.5 Stable [ Kuamini ] 21-June-2022 14:00 GMT
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
The file components/com_jevents/libraries/iCalEventDetail.php was changed to include this code

if ($this->dtstart < 0 || $this->dtend < 0)
{
$sql = "SHOW COLUMNS FROM #__jevents_vevdetail";
$db = Factory::getDbo();
$db->setQuery($sql);
$cols = @$db->loadObjectList("Field");

if (array_key_exists("dtstart", $cols) && strtolower($cols["dtstart"]->Type) == "int")
{
$sql = "ALTER TABLE #__jevents_vevdetail modify dtstart bigint NOT NULL";
$db->setQuery($sql);
@$db->execute();

$sql = "ALTER TABLE #__jevents_vevdetail modify dtend bigint NOT NULL";
$db->setQuery($sql);
@$db->execute();
}

}
between lines 271-289 - this should have changed the database column for dtstart to allow large negative numbers.

Do you have phpMyAdmin? Can you check the definitions of these 2 columns to see if they have been changed to 'bigint' ?
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
php Myadmin Says:


#__jevents_vevdetail

dtsstart int(11)
dtend int(11)
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I can set both to bigint by phpMyadmin.
dose that solve the Problem?
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I changed in phpMyadmin
dtsstart int(11)
dtend int(11)

to
dtsstart bigint(11)
dtend bigint(11)

no effect
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
bigint(11) is no use - it needs to be an unconstrained bigint though bigint(20) may work.
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
An error has occurred.

321 PROBLEMS_STORING_EVENT<br>There were problems saving the event detailProblem saving event Exception: Problem saving event Out of range value for column 'dtstart' at row 1 in /home/www/test/components/com_jevents/libraries/iCalEventDetail.php:296 Stack trace: #0 /home/www/test/components/com_jevents/libraries/iCalEvent.php(295): iCalEventDetail->store(false) #1 /home/www/test/administrator/components/com_jevents/libraries/saveIcalEvent.php(231): iCalEvent->store() #2 /home/www/test/administrator/components/com_jevents/controllers/icalevent.php(952): SaveIcalEvent::save(Array, Object(JEventsDBModel), Array) #3 /home/www/test/administrator/components/com_jevents/controllers/icalevent.php(1060): AdminIcaleventController->doSave('') #4 /home/www/test/libraries/src/MVC/Controller/BaseController.php(735): AdminIcaleventController->apply() #5 /home/www/test/administrator/components/com_jevents/jevents.php(268): Joomla\CMS\MVC\Controller\BaseController->execute('apply') #6 /home/www/test/libraries/src/Dispatcher/LegacyComponentDispatcher.php(69): require_once('/home/www/test/...') #7 /home/www/test/libraries/src/Dispatcher/LegacyComponentDispatcher.php(71): Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}('/home/www/test/...') #8 /home/www/test/libraries/src/Component/ComponentHelper.php(389): Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() #9 /home/www/test/libraries/src/Application/AdministratorApplication.php(143): Joomla\CMS\Component\ComponentHelper::renderComponent('com_jevents') #10 /home/www/test/libraries/src/Application/AdministratorApplication.php(186): Joomla\CMS\Application\AdministratorApplication->dispatch() #11 /home/www/test/libraries/src/Application/CMSApplication.php(278): Joomla\CMS\Application\AdministratorApplication->doExecute() #12 /home/www/test/administrator/includes/app.php(63): Joomla\CMS\Application\CMSApplication->execute() #13 /home/www/test/administrator/index.php(32): require_once('/home/www/test/...') #14 {main}
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
That is most strange - the attached version will tell us the value of dtstart that is causing the problem.
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I installed the update again. Still same erreor:

An error has occurred.

321 PROBLEMS_STORING_EVENT<br>There were problems saving the event detailProblem saving event Exception: Problem saving event (-3318641608) : Out of range value for column 'dtstart' at row 1 in /home/www/test/components/com_jevents/libraries/iCalEventDetail.php:296 Stack trace: #0 /home/www/test/components/com_jevents/libraries/iCalEvent.php(295): iCalEventDetail->store(false) #1 /home/www/test/administrator/components/com_jevents/libraries/saveIcalEvent.php(231): iCalEvent->store() #2 /home/www/test/administrator/components/com_jevents/controllers/icalevent.php(952): SaveIcalEvent::save(Array, Object(JEventsDBModel), Array) #3 /home/www/test/administrator/components/com_jevents/controllers/icalevent.php(737): AdminIcaleventController->doSave('') #4 /home/www/test/libraries/src/MVC/Controller/BaseController.php(735): AdminIcaleventController->save() #5 /home/www/test/administrator/components/com_jevents/jevents.php(268): Joomla\CMS\MVC\Controller\BaseController->execute('save') #6 /home/www/test/libraries/src/Dispatcher/LegacyComponentDispatcher.php(69): require_once('/home/www/test/...') #7 /home/www/test/libraries/src/Dispatcher/LegacyComponentDispatcher.php(71): Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}('/home/www/test/...') #8 /home/www/test/libraries/src/Component/ComponentHelper.php(389): Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() #9 /home/www/test/libraries/src/Application/AdministratorApplication.php(143): Joomla\CMS\Component\ComponentHelper::renderComponent('com_jevents') #10 /home/www/test/libraries/src/Application/AdministratorApplication.php(186): Joomla\CMS\Application\AdministratorApplication->dispatch() #11 /home/www/test/libraries/src/Application/CMSApplication.php(278): Joomla\CMS\Application\AdministratorApplication->doExecute() #12 /home/www/test/administrator/includes/app.php(63): Joomla\CMS\Application\CMSApplication->execute() #13 /home/www/test/administrator/index.php(32): require_once('/home/www/test/...') #14 {main}
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
According to https://dev.mysql.com/doc/refman/8.0/en/integer-types.html a bigint field should hold values between +/- 9.2 x 10^18 i.e. integers up to 18 digits long. There should be no problems storing a dtstart value of -3318641608 in a bigint column can you check what the database says is the definition of these 2 columns. I suspect they may not be full bigint columns
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
But i'm not shure that its a Problem of the database. Becaus using Jomla 3.1 i had same databas-system and no problem i Checked there it is at least a int(11) field. So it can not caused by them. Its a Problem of Joma 4 and the new Version of Jevent for 4.
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I was able to recreate the problem initially in Joomla 4 and once I'd updated the field type to bigint the problem was resolved.

The error message you are seeing is being thrown by MySQL not Joomla - see https://dev.mysql.com/doc/refman/5.7/en/out-of-range-and-overflow.html
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post