Groups Restrict Categories invalid taxonomy bug

Hey,
I’ve noticed that I’ve been having problems with groups restrict categories since enabling DEBUG_DISPLAY to test a plugin.
I thought it may have been the plugin I was testing however I noticed that after I disabled all plugins except Groups & Groups Restrict Categories, and changed my theme to 2015 then I would still get the error. The error went away when I disabled Groups Restrict Categories.

Th error appears on every single wordpress page (not posts or categories). These two lines are repeated.

Notice: Trying to get property of non-object in /home/technoto/public_html/wp-includes/category-template.php on line 1155
Warning: array_map(): Argument #2 should be an array in /home/technoto/public_html/wp-includes/category-template.php on line 1160

I did a bit of digging and it turns out that it is caused by user_can_read in class-groups-restrict-categories.php when it calls get_the_terms with an “invalid taxonomy” which confuses get_the_terms in category-template.php to process this object: O:8:"WP_Error":2:{s:6:"errors";a:1:{s:16:"invalid_taxonomy";a:1:{i:0;s:16:"Invalid taxonomy";}}s:10:"error_data";a:0:{}} where it is expecting an array of terms.

Could some please provide a fix so that I can continue using my site white relies on groups restrict categories? Thanks


Comments

3 responses to “Groups Restrict Categories invalid taxonomy bug”

  1. Hi Neil,

    Thanks for sharing.
    Please try removing both plugins and then reinstall them. For your convenience do not check the option under Groups>Options to delete all data on plugin deactivation, in order to keep your groups and capabilities.

    Kind regards,
    George

  2. Hi Neil,

    Please upgrade your plugins and WordPress to the latest versions, put your debug.log contents in a pastebin and share the link here.

    Kind regards,
    George

Share