So I installed Concrete on my local machine in order to build a website for a client. I used the Atomik theme, added a calendar, then went to add a calendar event. However I got an error message:
An exception occurred while executing 'INSERT INTO CalendarEvents (hasCustomSummaryTemplates, caID) VALUES (?, ?)' with params [0, 1]:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`reh`.`calendarevents`, CONSTRAINT `FK_7F23C55611C85723` FOREIGN KEY (`caID`) REFERENCES `Calendars` (`caID`))
Details
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php(68): Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException->null
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php(182): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php(159): Doctrine\DBAL\DBALException->wrapException
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php(2226): Doctrine\DBAL\DBALException->driverExceptionDuringQuery
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\Statement.php(185): Doctrine\DBAL\Connection->handleExceptionDuringQuery
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDO\Exception.php(18): Doctrine\DBAL\Driver\PDO\Exception->null
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php(119): Doctrine\DBAL\Driver\PDO\Exception->new
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php(117): PDOException->null
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php(117): PDOStatement->execute
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\Statement.php(179): Doctrine\DBAL\Driver\PDOStatement->execute
C:\xampp\htdocs\reh\vendor\doctrine\dbal\lib\Doctrine\DBAL\Statement.php(226): Doctrine\DBAL\Statement->execute
C:\xampp\htdocs\reh\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\Entity\BasicEntityPersister.php(278): Doctrine\DBAL\Statement->executeStatement
C:\xampp\htdocs\reh\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php(1133): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts
C:\xampp\htdocs\reh\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php(430): Doctrine\ORM\UnitOfWork->executeInserts
C:\xampp\htdocs\reh\vendor\doctrine\orm\lib\Doctrine\ORM\EntityManager.php(403): Doctrine\ORM\UnitOfWork->commit
C:\xampp\htdocs\reh\public\concrete\src\Calendar\Event\EventService.php(138): Doctrine\ORM\EntityManager->flush
C:\xampp\htdocs\reh\public\concrete\src\Calendar\Event\EventService.php(132): Concrete\Core\Calendar\Event\EventService->save
C:\xampp\htdocs\reh\public\concrete\controllers\dialog\event\edit.php(174): Concrete\Core\Calendar\Event\EventService->addEventVersion
C:\xampp\htdocs\reh\public\concrete\controllers\dialog\event\edit.php(224): Concrete\Controller\Dialog\Event\Edit->addCalendarEventVersionFromRequest
C:\xampp\htdocs\reh\public\concrete\src\Controller\AbstractController.php(318): Concrete\Controller\Dialog\Event\Edit->addEvent
C:\xampp\htdocs\reh\public\concrete\src\Controller\AbstractController.php(318): null->call_user_func_array
C:\xampp\htdocs\reh\public\concrete\src\Routing\ControllerRouteAction.php(64): Concrete\Core\Controller\AbstractController->runAction
C:\xampp\htdocs\reh\public\concrete\src\Http\RouteDispatcher.php(37): Concrete\Core\Routing\ControllerRouteAction->execute
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\DispatcherDelegate.php(39): Concrete\Core\Http\RouteDispatcher->dispatch
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\MiddlewareStack.php(86): Concrete\Core\Http\Middleware\DispatcherDelegate->next
C:\xampp\htdocs\reh\public\concrete\src\Http\DefaultDispatcher.php(127): Concrete\Core\Http\Middleware\MiddlewareStack->process
C:\xampp\htdocs\reh\public\concrete\src\Http\DefaultDispatcher.php(60): Concrete\Core\Http\DefaultDispatcher->handleDispatch
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\DispatcherDelegate.php(39): Concrete\Core\Http\DefaultDispatcher->dispatch
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\FrameOptionsMiddleware.php(39): Concrete\Core\Http\Middleware\DispatcherDelegate->next
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\MiddlewareDelegate.php(50): Concrete\Core\Http\Middleware\FrameOptionsMiddleware->process
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\StrictTransportSecurityMiddleware.php(36): Concrete\Core\Http\Middleware\MiddlewareDelegate->next
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\MiddlewareDelegate.php(50): Concrete\Core\Http\Middleware\StrictTransportSecurityMiddleware->process
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\ContentSecurityPolicyMiddleware.php(36): Concrete\Core\Http\Middleware\MiddlewareDelegate->next
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\MiddlewareDelegate.php(50): Concrete\Core\Http\Middleware\ContentSecurityPolicyMiddleware->process
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\CookieMiddleware.php(35): Concrete\Core\Http\Middleware\MiddlewareDelegate->next
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\MiddlewareDelegate.php(50): Concrete\Core\Http\Middleware\CookieMiddleware->process
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\ApplicationMiddleware.php(29): Concrete\Core\Http\Middleware\MiddlewareDelegate->next
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\MiddlewareDelegate.php(50): Concrete\Core\Http\Middleware\ApplicationMiddleware->process
C:\xampp\htdocs\reh\public\concrete\src\Http\Middleware\MiddlewareStack.php(86): Concrete\Core\Http\Middleware\MiddlewareDelegate->next
C:\xampp\htdocs\reh\public\concrete\src\Http\DefaultServer.php(85): Concrete\Core\Http\Middleware\MiddlewareStack->process
C:\xampp\htdocs\reh\public\concrete\src\Foundation\Runtime\Run\DefaultRunner.php(125): Concrete\Core\Http\DefaultServer->handleRequest
C:\xampp\htdocs\reh\public\concrete\src\Foundation\Runtime\DefaultRuntime.php(102): Concrete\Core\Foundation\Runtime\Run\DefaultRunner->run
C:\xampp\htdocs\reh\public\concrete\dispatcher.php(45): Concrete\Core\Foundation\Runtime\DefaultRuntime->run
C:\xampp\htdocs\reh\public\index.php(3): null->require
The calendar event is as simple as you can get. The title is “test”, the description is “test”, and I’m using the default date and time. Nothing else.
I haven’t made any major changes to the site, asides from editing the content like one normally would. I also got an error while attempting to update to the latest version, but I’ll make a separate post about that.
I’m not able to provide my environment information because going to Dashboard > System & Settings > Environment > Environment Information just yields Unable to load environment info
However I’m running:
- Concrete CMS: 9.1.1
- PHP: 8.1.6
- MariaDB: 10.4.24
- Apache: 2.4.53
- Composer: 2.4.2
This is a purely vanilla installation. I haven’t installed any third party extensions or themes. The most I’ve done is edit content, replaced some images using the file manager, and set up a form or two.
Is there anything I can do to work around this issue? Because my entire project is held up because being able to have a functional calendar is a critical part of the site