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
In the process, a question:
If $attributes ($original) if the entities have a string value, then casting fails. DatetimeCast expects an object, but actually contains $attributes['date_birth'] = '2001-05-03 19:56:00
[CodeIgniter\DataCaster\Cast\DatetimeCast] Invalid value type: string, and its value: '2001-05-03 19:56:00'
PHP Version
8.3
CodeIgniter4 Version
4.5.1
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Linux
Which server did you use?
cli-server (PHP built-in webserver)
Database
MariaDB 10
What happened?
Conversion to date does not work.
Steps to Reproduce
Add Model:
Select row from DB (get User object):
$this->userModel->get($userId);
See error:
Expected Output
Return Datetime object or null
Anything else?
I think it's worth considering $params[0] = 'nullable' state
https://github.com/codeigniter4/CodeIgniter4/blob/84e06d06b67b0bc8bea71dfa24f93264eec50b19/system/DataCaster/Cast/DatetimeCast.php#L46C1-L51
The text was updated successfully, but these errors were encountered: