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

[Bug] Column 'password' cannot be null for Users Model #73

Closed
altayevrim opened this issue Mar 27, 2024 · 2 comments
Closed

[Bug] Column 'password' cannot be null for Users Model #73

altayevrim opened this issue Mar 27, 2024 · 2 comments

Comments

@altayevrim
Copy link

Bug report

What I did

I used Jetstream and didn't change anything on User model. I generated the CRUD and when I want to edit a record I get Integrity constraint violation: 1048 Column 'password' cannot be nullerror.

What I expected to happen

It is a password field, shouldn't it accept null values and act accordingly?

Backpack, Laravel, PHP, DB version

PHP VERSION:

PHP 8.3.3 (cli) (built: Feb 16 2024 00:15:01) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.3, Copyright (c) Zend Technologies
with Zend OPcache v8.3.3, Copyright (c), by Zend Technologies

LARAVEL VERSION:

11.1.0.0

BACKPACK PACKAGE VERSIONS:

backpack/basset: 1.3.0
backpack/crud: 6.7.3
backpack/devtools: 3.1.0
backpack/generators: v4.0.4
backpack/pro: 2.1.11
backpack/theme-tabler: 1.2.8

Operating System and Server Setup

I encountered the problem above on my Mac OS machine, and my web server is set up using Herd Pro (MySQL)

@karandatwani92
Copy link

Hey @altayevrim

The password field only sets HTML <input type="password"/>.
You'll need to define the logic: "If the sent password is null, remove the password key from the request to skip the password update."

You can see the sample code in Backpack PermissionManager's UserCRUD.

I recommend you use PermissionManager . It would give you more out of the box.

@altayevrim
Copy link
Author

Thank you very much! :) I thought that it should work out of the box that's why thought it was a bug 😅

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

No branches or pull requests

2 participants