#4073
Vladimir
Keymaster

I found a reason. Your assumption about string length limit was near to true. But this limit was set by your hosting WP Engine (WPE). It has an automatically executed code at ‘mu-plugins’ folder which restricts SQL query text length to 16384 characters.
wp-content/mu-plugins/wp-engine-common/plugin.php, line #2518:


if ( $query_length > self::QUERY_LENGTH_MAX ) {
  return '';
}

SQL query you get for full list of categories grows up to 16543 characters long. WPE just prevents its execution writing to the system log:
“KILLED QUERY (16543 characters long generated: SELECT …”
It’s a pity, that they do this silently, without raising exception. So you and me should waste a time searching what’s going wrong.

What workaround is possible:
1) define WPE_GOVERNOR PHP constant with FALSE value, add this line to wp-config.php file:


define('WPE_GOVERNOR', false);

It should force WPE to ignore SQL query length.
Be aware, that it could not work if this PHP constant is defined already by WPE themselves. So just try it.

2) You have 3027 posts, plus some pages and events. When you restrict role by defining categories in which you prohibit to edit posts, there are 3228 post ID in the list, which are prohibited. If define categories in which you allow to edit posts, then this list will be much shorter: 68 items only.
I include comma separated list of post ID into the SELECT SQL query. That’s why this command could become longer then a limit set by WPE.