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

SQL error on user information update #63

Closed
richlove1 opened this issue May 8, 2013 · 11 comments
Closed

SQL error on user information update #63

richlove1 opened this issue May 8, 2013 · 11 comments
Labels

Comments

@richlove1
Copy link

If you submit the form at user/create you get an error about the username column not being in the SQL (because it's not in the form).

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'username' cannot be null (SQL: insert into users (username, email, password, confirmation_code, updated_at, created_at)

If you add the username in to the form and submit it, there is no error but if you change the email address of the user (which should be a valid action?) it creates a new record in the database rather than updating the user details with the new email address.

@andrew13
Copy link
Collaborator

andrew13 commented May 8, 2013

The username field is in the form. What url are you getting this at?

Both admin/users/create and users/create are working for me.

@richlove1
Copy link
Author

Apologies Andrew, I think I've thrown you off course here, it's not the create routes it's the profile update/user index routes (e.g. www.example.com/user). Try submitting this form? It has no username field and it also submits to postIndex() which seems quite tailored for the create submission (which is why i was wondering if there should be a postCreate() or postIndex() is supposed to handle user registration and user updates.

@andrew13
Copy link
Collaborator

andrew13 commented May 8, 2013

Ah, got it. I thought I had removed that page. I'll patch it up.

@richlove1
Copy link
Author

Great work, will have a look at this now. Just to let you know you have a duplicate form close tag in / app / views / site / user / index.blade.php

@richlove1
Copy link
Author

And ln57 of UserController.php should be

            ->with( 'notice', Lang::get('user/user.user_account_updated') );

not

            ->with( 'notice', Lang::get('user.user.user_account_updated') );

@richlove1
Copy link
Author

This still redirects to user.login even when the user is updating their details? They're already logged in so should probably direct to their profile page or something?

@richlove1
Copy link
Author

Also, the update form only updates if the user enters their password/confirm password, that's probably not desired behaviour is it? They shouldn't have to do that if they're already logged in.

If they don't enter their password, they updates don't take effect but you still get the message 'user account updated'.

(sorry for all the comments, should I raise new issues?)

@richlove1
Copy link
Author

There is also an error on submission of the user/create form (using {{ Confide::makeSignupForm()->render() }} to generate the form)

The error is:

Missing argument 1 for UserController::postIndex()

Because that function is now expecting a User object? I think the function still has dual purposes (probably by design) of handling user creation and user updates but isn't quite handling both (either) at the moment.

@richlove1
Copy link
Author

Any thoughts?

@richlove1
Copy link
Author

I see you've been doing fixes.... that relate to this also 👍

@andrew13
Copy link
Collaborator

Yeah I'll have this updated shortly when I merge the phpunit test branch.

andrew13 added a commit that referenced this issue May 27, 2013
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