By Phrixos on Thursday, 18 August 2022
Replies 14
Likes 0
Views 1.6K
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)
·
Wednesday, 24 August 2022 12:34
·
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
·
Wednesday, 24 August 2022 12:54
·
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
·
Thursday, 25 August 2022 12:25
·
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' ?
·
Thursday, 25 August 2022 13:51
·
0 Likes
·
0 Votes
·
0 Comments
·
php Myadmin Says:


#__jevents_vevdetail

dtsstart int(11)
dtend int(11)
·
Thursday, 25 August 2022 14:08
·
0 Likes
·
0 Votes
·
0 Comments
·
I can set both to bigint by phpMyadmin.
dose that solve the Problem?
·
Thursday, 25 August 2022 14:11
·
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
·
Thursday, 25 August 2022 14:17
·
0 Likes
·
0 Votes
·
0 Comments
·
bigint(11) is no use - it needs to be an unconstrained bigint though bigint(20) may work.
·
Thursday, 25 August 2022 14:50
·
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}
·
Thursday, 25 August 2022 15:05
·
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.
·
Thursday, 25 August 2022 16:55
·
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}
·
Thursday, 25 August 2022 17:11
·
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
·
Friday, 26 August 2022 08:09
·
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.
·
Friday, 26 August 2022 11:07
·
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
·
Wednesday, 31 August 2022 14:22
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post