-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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]: When saving [],0,'0',false in cache null is returned #15125
Comments
As a workaround for now i just override set/get methods and saved other value for this empty values and then return correct one if someone other had similar issue. |
DId you try to specify server config?
|
Yes, when saving 1 or 2 or any other value(basically non empty value) it works correctly @Jeckerson |
I use Phalcon 4.0.6 and also is the same problem. I use cache with file and cache with APCu. In cache file is correct write value "false" in file on the disk, error is in method "get()". |
It is problem: // phalcon/Storage/Adapter/AbstractAdapter.zep
protected function getUnserializedData(var content, var defaultValue = null) -> var
{
// HERE IS PROBLEM
if !content {
return defaultValue;
}
// .....
} https://github.com/phalcon/cphalcon/blob/master/phalcon/Storage/Adapter/AbstractAdapter.zep |
Why save empty value cache when it can be just removed? |
Empty value such FALSE, 0, '0', [] is normal value. |
Exactly empty value is normal value. Honestly I am not sure if code above is issue, but will check it later. |
Storage adapters returning wrong data when data is emptry array Fixes #15125
Resolved in #15350 |
Describe the bug
When using libmemcached for cache adapter and saving empty array or false or 0 and then getting a key null is returned instead of empty array/0/false.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Return empty array instead of null
Details
The text was updated successfully, but these errors were encountered: