-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: Model cannot insert when $useAutoIncrement is false #6827
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: Model cannot insert when $useAutoIncrement is false #6827
Conversation
When inserting, PK data is neccessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good change. I've been using a workaround in a base Model in a project that uses UUIDs so I didn't even notice that this was an issue!
system/Model.php
Outdated
* | ||
* @var int|string|null | ||
*/ | ||
private $tempPrimaryKeyData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "data"? If differentiating from the name I think "value" would be more consistent with what we usually do for a single item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, value is better.
Fixed.
This also happens in the model's |
@MaulanaMalikS If you find another bug, please report it. |
Description
From https://forum.codeigniter.com/showthread.php?tid=84733
$primaryKey
field should never be an allowed field.Checklist: