Integrity constraint violation 1048 Column cParentID cannot be null
Permalink
I just tried setting up a new c5 project based on 5.8.2. After setting up two new locales and deleting the original locale, I get an error message when trying to add a new page, both via the sitemap and "Add Pages"
The problem can be reproduced as follows.
1) install concrete5 (8.2)
2) add new locale in multilingual setup
3) set default locale to that new locale
4) delete that original locale
5) create new locale
6) try to add a page
Another thread suggests simply not touching the original locale :/https://www.concrete5.org/community/forums/usage/missing-sitetree-ca...
Has anyone else encountered this issue and solved it?
And here's a stacktrace:
[/code]
#30 Doctrine\DBAL\Exception\NotNullConstraintViolationException in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:112
#29 Doctrine\DBAL\Driver\AbstractMySQLDriver:convertException in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:128
#28 Doctrine\DBAL\DBALException:driverExceptionDuringQuery in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:177
#27 Doctrine\DBAL\Driver\PDOException in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93
#26 PDOException in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
#25 PDOStatement:execute in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
#24 Doctrine\DBAL\Driver\PDOStatement:execute in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:168
#23 Doctrine\DBAL\Statement:execute in /var/www/html/c58domdev/concrete/src/Page/Page.php:3078
#22 Concrete\Core\Page\Page:add in /var/www/html/c58domdev/concrete/src/Page/Type/Type.php:1164
#21 Concrete\Core\Page\Type\Type:createDraft in /var/www/html/c58domdev/concrete/controllers/backend/page.php:32
#20 Concrete\Controller\Backend\Page:create in /var/www/html/c58domdev/concrete/src/Controller/AbstractController.php:172
#19 call_user_func_array in /var/www/html/c58domdev/concrete/src/Controller/AbstractController.php:172
#18 Concrete\Core\Controller\AbstractController:runAction in /var/www/html/c58domdev/concrete/src/Routing/ControllerRouteCallback.php:27
#17 Concrete\Core\Routing\ControllerRouteCallback:execute in /var/www/html/c58domdev/concrete/src/Routing/Router.php:149
#16 Concrete\Core\Routing\Router:execute in /var/www/html/c58domdev/concrete/src/Http/DefaultDispatcher.php:114
#15 Concrete\Core\Http\DefaultDispatcher:handleDispatch in /var/www/html/c58domdev/concrete/src/Http/DefaultDispatcher.php:54
#14 Concrete\Core\Http\DefaultDispatcher:dispatch in /var/www/html/c58domdev/concrete/src/Http/Middleware/DispatcherDelegate.php:39
#13 Concrete\Core\Http\Middleware\DispatcherDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/ThumbnailMiddleware.php:60
#12 Concrete\Core\Http\Middleware\ThumbnailMiddleware:process in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareDelegate.php:38
#11 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/FrameOptionsMiddleware.php:39
#10 Concrete\Core\Http\Middleware\FrameOptionsMiddleware:process in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareDelegate.php:38
#9 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/CookieMiddleware.php:37
#8 Concrete\Core\Http\Middleware\CookieMiddleware:process in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareDelegate.php:38
#7 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/ApplicationMiddleware.php:29
#6 Concrete\Core\Http\Middleware\ApplicationMiddleware:process in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareDelegate.php:38
#5 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareStack.php:86
#4 Concrete\Core\Http\Middleware\MiddlewareStack:process in /var/www/html/c58domdev/concrete/src/Http/DefaultServer.php:85
#3 Concrete\Core\Http\DefaultServer:handleRequest in /var/www/html/c58domdev/concrete/src/Foundation/Runtime/Run/DefaultRunner.php:115
#2 Concrete\Core\Foundation\Runtime\Run\DefaultRunner:run in /var/www/html/c58domdev/concrete/src/Foundation/Runtime/DefaultRuntime.php:102
#1 Concrete\Core\Foundation\Runtime\DefaultRuntime:run in /var/www/html/c58domdev/concrete/dispatcher.php:39
#0 require in /var/www/html/c58domdev/index.php:3
[/code]
Doctrine\DBAL\Exception\NotNullConstraintViolationException thrown with message "An exception occurred while executing 'insert into Pages (cID, siteTreeID, ptID, cParentID, uID, cInheritPermissionsFrom, cOverrideTemplatePermissions, cInheritPermissionsFromCID, cDisplayOrder, pkgID, cIsActive) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["187", null, "5", null, "1", "TEMPLATE", null, 155, 0, 0, 0]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'cParentID' cannot be null"
The problem can be reproduced as follows.
1) install concrete5 (8.2)
2) add new locale in multilingual setup
3) set default locale to that new locale
4) delete that original locale
5) create new locale
6) try to add a page
Another thread suggests simply not touching the original locale :/https://www.concrete5.org/community/forums/usage/missing-sitetree-ca...
Has anyone else encountered this issue and solved it?
And here's a stacktrace:
[/code]
#30 Doctrine\DBAL\Exception\NotNullConstraintViolationException in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:112
#29 Doctrine\DBAL\Driver\AbstractMySQLDriver:convertException in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:128
#28 Doctrine\DBAL\DBALException:driverExceptionDuringQuery in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:177
#27 Doctrine\DBAL\Driver\PDOException in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93
#26 PDOException in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
#25 PDOStatement:execute in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
#24 Doctrine\DBAL\Driver\PDOStatement:execute in /var/www/html/c58domdev/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:168
#23 Doctrine\DBAL\Statement:execute in /var/www/html/c58domdev/concrete/src/Page/Page.php:3078
#22 Concrete\Core\Page\Page:add in /var/www/html/c58domdev/concrete/src/Page/Type/Type.php:1164
#21 Concrete\Core\Page\Type\Type:createDraft in /var/www/html/c58domdev/concrete/controllers/backend/page.php:32
#20 Concrete\Controller\Backend\Page:create in /var/www/html/c58domdev/concrete/src/Controller/AbstractController.php:172
#19 call_user_func_array in /var/www/html/c58domdev/concrete/src/Controller/AbstractController.php:172
#18 Concrete\Core\Controller\AbstractController:runAction in /var/www/html/c58domdev/concrete/src/Routing/ControllerRouteCallback.php:27
#17 Concrete\Core\Routing\ControllerRouteCallback:execute in /var/www/html/c58domdev/concrete/src/Routing/Router.php:149
#16 Concrete\Core\Routing\Router:execute in /var/www/html/c58domdev/concrete/src/Http/DefaultDispatcher.php:114
#15 Concrete\Core\Http\DefaultDispatcher:handleDispatch in /var/www/html/c58domdev/concrete/src/Http/DefaultDispatcher.php:54
#14 Concrete\Core\Http\DefaultDispatcher:dispatch in /var/www/html/c58domdev/concrete/src/Http/Middleware/DispatcherDelegate.php:39
#13 Concrete\Core\Http\Middleware\DispatcherDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/ThumbnailMiddleware.php:60
#12 Concrete\Core\Http\Middleware\ThumbnailMiddleware:process in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareDelegate.php:38
#11 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/FrameOptionsMiddleware.php:39
#10 Concrete\Core\Http\Middleware\FrameOptionsMiddleware:process in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareDelegate.php:38
#9 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/CookieMiddleware.php:37
#8 Concrete\Core\Http\Middleware\CookieMiddleware:process in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareDelegate.php:38
#7 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/ApplicationMiddleware.php:29
#6 Concrete\Core\Http\Middleware\ApplicationMiddleware:process in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareDelegate.php:38
#5 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /var/www/html/c58domdev/concrete/src/Http/Middleware/MiddlewareStack.php:86
#4 Concrete\Core\Http\Middleware\MiddlewareStack:process in /var/www/html/c58domdev/concrete/src/Http/DefaultServer.php:85
#3 Concrete\Core\Http\DefaultServer:handleRequest in /var/www/html/c58domdev/concrete/src/Foundation/Runtime/Run/DefaultRunner.php:115
#2 Concrete\Core\Foundation\Runtime\Run\DefaultRunner:run in /var/www/html/c58domdev/concrete/src/Foundation/Runtime/DefaultRuntime.php:102
#1 Concrete\Core\Foundation\Runtime\DefaultRuntime:run in /var/www/html/c58domdev/concrete/dispatcher.php:39
#0 require in /var/www/html/c58domdev/index.php:3
[/code]
1) install concrete5 (8.2)
2) add new locale in multilingual setup
3) set default locale to that new locale
4) try to add a page
I get the same error message as above. As soon as I switch the default locale back to the original en_GB, I can add pages again.
There is now an issue on GitHub open for this:https://github.com/concrete5/concrete5/issues/5750...