Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on delete user who has express enties #8066

Merged
merged 2 commits into from Aug 21, 2019

Conversation

hissy
Copy link
Contributor

@hissy hissy commented Aug 15, 2019

This pull request fixes below error when deleting a user who is an owner of express entries.

Error message:

Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException thrown with message "An exception occurred while executing 'DELETE FROM Users WHERE uID = ?' with params [4]:

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`concrete5`.`expressentityentries`, CONSTRAINT `FK_B8AE3531FD71026C` FOREIGN KEY (`uID`) REFERENCES `Users` (`uID`))"

Stacktrace:
#42 Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException in /path/to/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60
#41 Doctrine\DBAL\Driver\AbstractMySQLDriver:convertException in /path/to/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:128
#40 Doctrine\DBAL\DBALException:driverExceptionDuringQuery in /path/to/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1015
#39 Doctrine\DBAL\Driver\PDOException in /path/to/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107
#38 PDOException in /path/to/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105
#37 PDOStatement:execute in /path/to/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105
#36 Doctrine\DBAL\Driver\PDOStatement:execute in /path/to/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1006
#35 Doctrine\DBAL\Connection:executeUpdate in /path/to/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:596
#34 Doctrine\DBAL\Connection:delete in /path/to/concrete/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:580
#33 Doctrine\ORM\Persisters\Entity\BasicEntityPersister:delete in /path/to/concrete/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1094
#32 Doctrine\ORM\UnitOfWork:executeDeletions in /path/to/concrete/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:406
#31 Doctrine\ORM\UnitOfWork:commit in /path/to/concrete/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:356
#30 Doctrine\ORM\EntityManager:flush in /path/to/concrete/src/User/UserInfo.php:280
#29 Concrete\Core\User\UserInfo:delete in /path/to/concrete/src/Workflow/Request/DeleteUserRequest.php:39
#28 Concrete\Core\Workflow\Request\DeleteUserRequest:approve in /path/to/concrete/src/Workflow/EmptyWorkflow.php:24
#27 Concrete\Core\Workflow\EmptyWorkflow:start in /path/to/concrete/src/Workflow/Progress/Progress.php:239
#26 Concrete\Core\Workflow\Progress\Progress:start in /path/to/concrete/src/Workflow/Request/UserRequest.php:68
#25 Concrete\Core\Workflow\Request\UserRequest:addWorkflowProgress in /path/to/concrete/src/Workflow/Request/Request.php:142
#24 Concrete\Core\Workflow\Request\Request:triggerRequest in /path/to/concrete/src/Workflow/Request/UserRequest.php:45
#23 Concrete\Core\Workflow\Request\UserRequest:trigger in /path/to/concrete/src/User/UserInfo.php:197
#22 Concrete\Core\User\UserInfo:triggerDelete in /path/to/concrete/controllers/single_page/dashboard/users/search.php:137
#21 Concrete\Controller\SinglePage\Dashboard\Users\Search:update_status in /path/to/concrete/src/Controller/AbstractController.php:294
#20 call_user_func_array in /path/to/concrete/src/Controller/AbstractController.php:294
#19 Concrete\Core\Controller\AbstractController:runAction in /path/to/concrete/src/Http/ResponseFactory.php:188
#18 Concrete\Core\Http\ResponseFactory:controller in /path/to/concrete/src/Http/ResponseFactory.php:362
#17 Concrete\Core\Http\ResponseFactory:collection in /path/to/concrete/src/Http/DefaultDispatcher.php:130
#16 Concrete\Core\Http\DefaultDispatcher:handleDispatch in /path/to/concrete/src/Http/DefaultDispatcher.php:58
#15 Concrete\Core\Http\DefaultDispatcher:dispatch in /path/to/concrete/src/Http/Middleware/DispatcherDelegate.php:39
#14 Concrete\Core\Http\Middleware\DispatcherDelegate:next in /path/to/concrete/src/Http/Middleware/ThumbnailMiddleware.php:76
#13 Concrete\Core\Http\Middleware\ThumbnailMiddleware:process in /path/to/concrete/src/Http/Middleware/MiddlewareDelegate.php:50
#12 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /path/to/concrete/src/Http/Middleware/FrameOptionsMiddleware.php:39
#11 Concrete\Core\Http\Middleware\FrameOptionsMiddleware:process in /path/to/concrete/src/Http/Middleware/MiddlewareDelegate.php:50
#10 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /path/to/concrete/src/Http/Middleware/CookieMiddleware.php:35
#9 Concrete\Core\Http\Middleware\CookieMiddleware:process in /path/to/concrete/src/Http/Middleware/MiddlewareDelegate.php:50
#8 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /path/to/concrete/src/Http/Middleware/ApplicationMiddleware.php:29
#7 Concrete\Core\Http\Middleware\ApplicationMiddleware:process in /path/to/concrete/src/Http/Middleware/MiddlewareDelegate.php:50
#6 Concrete\Core\Http\Middleware\MiddlewareDelegate:next in /path/to/concrete/src/Http/Middleware/MiddlewareStack.php:86
#5 Concrete\Core\Http\Middleware\MiddlewareStack:process in /path/to/concrete/src/Http/DefaultServer.php:85
#4 Concrete\Core\Http\DefaultServer:handleRequest in /path/to/concrete/src/Foundation/Runtime/Run/DefaultRunner.php:119
#3 Concrete\Core\Foundation\Runtime\Run\DefaultRunner:run in /path/to/concrete/src/Foundation/Runtime/DefaultRuntime.php:102
#2 Concrete\Core\Foundation\Runtime\DefaultRuntime:run in /path/to/concrete/dispatcher.php:36
#1 require in /path/to/index.php:3
#0 require in ~/.composer/vendor/laravel/valet/server.php:158

@hissy
Copy link
Contributor Author

hissy commented Aug 15, 2019

@aembler aembler merged commit bd802c5 into concretecms:develop Aug 21, 2019
@hissy hissy deleted the fix/delete_user branch August 21, 2019 04:37
acohin pushed a commit to acohin/concrete5 that referenced this pull request Feb 9, 2020
Fix error on delete user who has express enties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants