-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[5.8] Fixed cache repository getMultiple implementation #29047
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct. Good catch 👍
Good catch by Bugsnag when I deployed to production like a fool, then had thousands of errors. 😆 |
12e97cf
to
67fad0d
Compare
Nice catch! I encountered this as well 😄 |
@crynobone that's very odd. From what I can see in the current implementation on the 5.8 branch that cannot happen. The keys from the first array are used as keys in a new array and every value for each key is the default (which can be an array). Then those keys are filtered as values for the Can you perhaps provide a failing test that proves the bug? |
It's happening for |
This does not work for tagged caches. I'll submit a fix. |
Please send your fix to the 6.x branch. 5.8 is not accepting bug fixes anymore. |
👍 |
The
$default
param ofPsr\SimpleCache\CacheInterface::getMultiple
is meant to be the default value, and not an array of defaults, or something of a similar formFor example, Symfony call
getMultiple
usingnew stdClass
as the defaultm which crashes, because Laravel is trying to iterate over the parameter, instead of using it as the default.