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

#change current() to next() in simpleauth to get the first result #119

Open
wants to merge 1 commit into
base: 1.9/develop
from

Conversation

@hrz11
Copy link

commented Aug 5, 2018

DB::select_array->execute()->current() is always null even though there are results in the array. Using next() will get the first one.

There may be a better way to resolve it but that worked for me

I was upgrading my fuelphp 1.0 -> 1.9, php 5.3 -> 7.*

@hrz11 hrz11 changed the title #change current() to next() in simpleauth get the first result #change current() to next() in simpleauth to get the first result Aug 5, 2018
@WanWizard

This comment has been minimized.

Copy link
Member

commented Aug 5, 2018

You might not be up to date with the latest updates. This was a bug in the database result class, that has been fixed in 1.9/develop and should also be fixed in the latest 1.8.1 hotfix.

@hrz11

This comment has been minimized.

Copy link
Author

commented Aug 7, 2018

Just in case tested it again with 1.8.1 and also with 1.9/develop that I am currently using. Result is the same - the database result class returns null.
Simpleauth is the only place I could find current() used with DB::select_array...maybe that is the right place to dig.

@WanWizard

This comment has been minimized.

Copy link
Member

commented Aug 9, 2018

To be able to debug this:

  • What DB driver are you using?
  • what is the config value of "enable_cache"?
  • what happens if you change the cache (true -> false or v.v.)?
@hrz11

This comment has been minimized.

Copy link
Author

commented Aug 10, 2018

  1. DB driver: mysql, enable_cache: false -> returns null
  2. DB driver: mysql, enable_cache: true -> works properly
  3. DB driver: mysqli, enable_cache: false -> returns null
  4. DB driver: mysqli, enable_cache: true -> works properly
    The first set of settings is my original. Would like to keep it that way.
@WanWizard

This comment has been minimized.

Copy link
Member

commented Aug 14, 2018

Thanks, I'll have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.