-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Undefined index errors filling log after purging object cache #500
Comments
Exit foreach loop early if certain data are not defined. When undefined they cause many PHP notices. Fixes johnbillion#500
Thanks for the PR. I wonder what the root cause is. I'll do some investigation. |
As this happens on the server I can't really test locally. I don't have a similar cache present. I'll see if I can't write some stuff to the error logs. |
I'm sorry for the dump but... With the following code in foreach ( $data['http'] as $key => $row ) {
if ( ! isset( $row['ltime'], $row['component'] ) ){
error_log('cache purge: ' . var_export($row,true) );
//continue;
}
|
Seems to be related to WordPress API calls. Each entry starts with |
These are the respective
|
So far adding this as a check also seems to solve the issue.
|
It appears that the last 3 elements of the array |
I have the exact same problem: the last 3 elements of the array These missing keys are added by method The reason comes from the fact this method is called once but, at the time it's called, the rows which will later exhibit the problem are not in the I discovered this by adding a But it's weird, because this method is called during
|
The reason I give in my previous comment explaining the notices is probably the same for everyone: HTTP requests are made during the shutdown process in between the execution of the For me, the culprit was a caching plugin hooked on the Solution: The error would not happen if the
|
I'm using SpinupWP and when I purge the cache my error.log if filled with the following PHP notices.
This is reproducible for me every time I purge the object cache.
The text was updated successfully, but these errors were encountered: