-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them
Description
PHP Version
8.2
CodeIgniter4 Version
4.7.0
CodeIgniter4 Installation Method
Manual (zip or tar.gz)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Environment
production
Database
SQLServer
What happened?
updateBatch() now consider $index is not changed and throw a exception "the index is missing in the data"
it was working before 4.7.0
Steps to Reproduce
// $returnType = \App\Entities\User::class
$user = $userModel->find($id);
$user->email = 'newemail@domain.com';
$userModel->updateBatch([$user], 'user_id');
Return :
CodeIgniter\Exceptions\InvalidArgumentException: The index ("user_id") for updateBatch() is missing in the data: {"email":"newemail@domain.com"}
Expected Output
The index or at least the primary key must be preserve, because when you update a row, you never change it
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them