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: [CI 4.5.0] Time object when savin date (login, user, etc) with MySQLI driver #1086

Closed
nicojmb opened this issue Apr 7, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@nicojmb
Copy link

nicojmb commented Apr 7, 2024

PHP Version

8.1

CodeIgniter4 Version

4.5.0

Shield Version

1.0.2

Which operating systems have you tested for this bug?

Linux

Which server did you use?

apache

Database

MariaDB 10.5.24

Did you customize Shield?

No

What happened?

In CI 4.5.0 it's forbidden pass an object to save value in MYSQL driver, the value must be a string, located in:

  • UserIdentityModel --> Line 445
  • TokenLoginModel --> Line 38
  • RememberModel -->Line 47 & Line 62
  • LoginModel --> Line 83 & Line 124

*** I think that is more easy fix in CI4 4.5.0 directly adding (string) before value.

Steps to Reproduce

Install CI 4.5.0 and login

Expected Output

Correct login

Anything else?

No response

@nicojmb nicojmb added the bug Something isn't working label Apr 7, 2024
@kenjis
Copy link
Member

kenjis commented Apr 7, 2024

In CI 4.5.0 it's forbidden pass an object to save value in MYSQL driver, the value must be a string

Why?

@kenjis kenjis changed the title Bug: Time object when savin date (login, user, etc) in CI 4.5.0 with MySQLI driver Bug: [CI 4.5.0] Time object when savin date (login, user, etc) with MySQLI driver Apr 8, 2024
@kenjis
Copy link
Member

kenjis commented Apr 8, 2024

Hmmm, I didn't notice but there are many flows that the data passed to Model is not handled by timeToString().

The tests for #1027 passed just because CI did not use strict types.

@GeneralFutz
Copy link

GeneralFutz commented Apr 8, 2024

I have similar issues after fix from #1087. Many places where Time::now() is being called and returning the object. Places that might have been Time::now()->format(Y-m-d H:m:s) in earlier versions . Temporary fix in those places seems to be getting to successful logins and registration.

@kenjis
Copy link
Member

kenjis commented Apr 14, 2024

Upgrade to CI v4.5.1 and Shield v1.0.3.

@kenjis kenjis closed this as completed Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants