You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some debugging I found that the roles property of WP_User is not guaranteed to be an array starting with an index of 0. It could be any numerical value.
Attaching a change that prevents this from blocking the log item.
The text was updated successfully, but these errors were encountered:
Working on a site and noticed debug.log instances where the following would occur:
WordPress database error Column 'user_role' cannot be null for query INSERT INTO
wp_stream``Looked around and tracked it this line in classes/class-log.php
'user_role' => (string) ! empty( $user->roles ) ? $user->roles[0] : '',
After some debugging I found that the roles property of WP_User is not guaranteed to be an array starting with an index of 0. It could be any numerical value.
Attaching a change that prevents this from blocking the log item.
The text was updated successfully, but these errors were encountered: