You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the Query Builder, the getWhere method crashes if no offset is given with "Argument 2 passed to CodeIgniter\Database\BaseBuilder::limit() must be of the type int, null given"
The default offset should be zero, and if an int is entered, it would use that.
CodeIgniter 4 version
BETA4
Affected module(s)
/vendor/codeigniter4/framework/system/Database/BaseBuilder.php line 1612
Expected behavior, and steps to reproduce if appropriate
->getWhere([
'email' => $email,
], 1);
will crash
->getWhere([
'email' => $email,
], 1, 0);
will run as expected.
Suggest changing line 1603 of /vendor/codeigniter4/framework/system/Database/BaseBuilder.php
from
public function getWhere($where = null, int $limit = null, int $offset = null)
to
public function getWhere($where = null, int $limit = null, int $offset = 0)
Context
PHP version 7.3.8
The text was updated successfully, but these errors were encountered:
Describe the bug
When using the Query Builder, the getWhere method crashes if no offset is given with "Argument 2 passed to CodeIgniter\Database\BaseBuilder::limit() must be of the type int, null given"
The default offset should be zero, and if an int is entered, it would use that.
CodeIgniter 4 version
BETA4
Affected module(s)
/vendor/codeigniter4/framework/system/Database/BaseBuilder.php line 1612
Expected behavior, and steps to reproduce if appropriate
->getWhere([
'email' => $email,
], 1);
will crash
->getWhere([
'email' => $email,
], 1, 0);
will run as expected.
Suggest changing line 1603 of /vendor/codeigniter4/framework/system/Database/BaseBuilder.php
from
public function getWhere($where = null, int $limit = null, int $offset = null)
to
public function getWhere($where = null, int $limit = null, int $offset = 0)
Context
The text was updated successfully, but these errors were encountered: