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

Error on Import Users -> CSV Upload [1364 Field 'notes' doesn't have a default value] #822

Closed
dfx-project opened this issue May 28, 2015 · 3 comments
Labels

Comments

@dfx-project
Copy link

@snipe Thanks for your help yesterday! Everything is running great, except (and I think it's basically the same issue you addressed in #818 but in a different place) when I try to upload a CSV file to import users, I get the following:

SQLSTATE[HY000]: General error: 1364 Field 'notes' doesn't have a default value (SQL: insert into users (first_name, last_name, email, password, activated, permissions) values (potato, chip, [email protected], b7Tuj4P6wA, 0, {"user":1}))

@snipe snipe added the ✋ bug Confirmed bug label Jun 9, 2015
@snipe
Copy link
Owner

snipe commented Jun 9, 2015

Yeah, so this looks like it's related to MySQL being in strict mode again.

Around line 636 in app/controllers/admin/UsersController.php, can you change:

                        $newuser = array(
                            'first_name' => $row[0],
                            'last_name' => $row[1],
                            'email' => $row[2],
                            'password' => $pass,
                            'activated' => $activated,
                            'permissions'   => '{"user":1}'
                        );

to this:

                        $newuser = array(
                            'first_name' => $row[0],
                            'last_name' => $row[1],
                            'email' => $row[2],
                            'password' => $pass,
                            'activated' => $activated,
                            'permissions'   => '{"user":1}',
                            'notes'     => 'Imported user'
                        );

and try importing again?

@snipe
Copy link
Owner

snipe commented Jun 15, 2015

Any luck?

@snipe snipe closed this as completed in 7820efc Jun 15, 2015
@dfx-project
Copy link
Author

@snipe I haven't had the opportunity to modify the code you'd mentioned, but I trust that it will work! I will report back if I get the opportunity to test that out. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants