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

Upgrade 2.05 --> 2.06: Error when edit user profile #1400

Closed
cgresser opened this issue Nov 26, 2015 · 4 comments
Closed

Upgrade 2.05 --> 2.06: Error when edit user profile #1400

cgresser opened this issue Nov 26, 2015 · 4 comments
Labels
❓ not sure if bug This issue has not been confirmed as a bug yet

Comments

@cgresser
Copy link

Hey,

i've got an error when i want to edit the profile of an users

Illuminate\Database\QueryException thrown with message "SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (snipeit.users, CONSTRAINT users_company_id_foreign FOREIGN KEY (company_id) REFERENCES companies (id)) (SQL: update users set permissions = {"admin":1,"user":1,"superuser":-1}, updated_at = 2015-11-26 09:27:24, phone = , jobtitle = , employee_num = , company_id = where id = 1)"

Stacktrace:
#32 Illuminate\Database\QueryException in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Connection.php:625
#31 Controllers\Admin\UsersController:postEdit in <#unknown>:0
#30 Illuminate\Routing\Router:Illuminate\Routing{closure} in <#unknown>:0
#29 PDOException in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Connection.php:391
#28 PDOStatement:execute in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Connection.php:391
#27 Illuminate\Database\Connection:Illuminate\Database{closure} in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Connection.php:617
#26 Illuminate\Database\Connection:runQueryCallback in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Connection.php:581
#25 Illuminate\Database\Connection:run in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Connection.php:394
#24 Illuminate\Database\Connection:affectingStatement in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Connection.php:339
#23 Illuminate\Database\Connection:update in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1925
#22 Illuminate\Database\Query\Builder:update in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:316
#21 Illuminate\Database\Eloquent\Builder:update in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1515
#20 Illuminate\Database\Eloquent\Model:performUpdate in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1448
#19 Illuminate\Database\Eloquent\Model:save in /home/www-data/assets/vendor/cartalyst/sentry/src/Cartalyst/Sentry/Users/Eloquent/User.php:317
#18 Cartalyst\Sentry\Users\Eloquent\User:save in /home/www-data/assets/app/controllers/admin/UsersController.php:435
#17 Controllers\Admin\UsersController:postEdit in <#unknown>:0
#16 call_user_func_array in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:231
#15 Illuminate\Routing\Controller:callAction in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:93
#14 Illuminate\Routing\ControllerDispatcher:call in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:62
#13 Illuminate\Routing\ControllerDispatcher:dispatch in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Routing/Router.php:967
#12 Illuminate\Routing\Router:Illuminate\Routing{closure} in <#unknown>:0
#11 call_user_func_array in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Routing/Route.php:109
#10 Illuminate\Routing\Route:run in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Routing/Router.php:1033
#9 Illuminate\Routing\Router:dispatchToRoute in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Routing/Router.php:1001
#8 Illuminate\Routing\Router:dispatch in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:775
#7 Illuminate\Foundation\Application:dispatch in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:745
#6 Illuminate\Foundation\Application:handle in /home/www-data/assets/vendor/barryvdh/laravel-debugbar/src/Middleware/Stack.php:34
#5 Barryvdh\Debugbar\Middleware\Stack:handle in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Session/Middleware.php:72
#4 Illuminate\Session\Middleware:handle in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php:47
#3 Illuminate\Cookie\Queue:handle in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php:51
#2 Illuminate\Cookie\Guard:handle in /home/www-data/assets/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23
#1 Stack\StackedHttpKernel:handle in /home/www-data/assets/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:641
#0 Illuminate\Foundation\Application:run in /home/www-data/assets/public/index.php:49

I hope you can help me

@snipe
Copy link
Owner

snipe commented Nov 26, 2015

Are you running mysql in strict mode?

@cgresser
Copy link
Author

no, we have disable strict mode

@snipe
Copy link
Owner

snipe commented Dec 1, 2015

If you pull the latest from master, does this still happen?

@snipe snipe added the ❓ not sure if bug This issue has not been confirmed as a bug yet label Dec 1, 2015
@cgresser
Copy link
Author

updated to the latest version, no bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ not sure if bug This issue has not been confirmed as a bug yet
Projects
None yet
Development

No branches or pull requests

2 participants