Thread Starter
Dennis
(@enggsoldennis)
I’ve looked into the code, and found that this part is causing the error
if ( method_exists( 'Groups_Restrict_Categories', 'user_can_read' ) ) {
$is_restricted_by_term = !Groups_Restrict_Categories::user_can_read( $current_post_id );
}
so I tried replacing the first line
if ( class_exists( 'Groups_Restrict_Categories' ) ) {
$is_restricted_by_term = !Groups_Restrict_Categories::user_can_read( $current_post_id );
}
and that fixed the error 500
Hi,
Many thanks for sharing that. I’ve just seen your post here, had I seen it before it could have saved me a couple of hours 😉 You’re right, the call to method_exists() is involved in the issue. There is a bug in some versions of PHP where a call to method_exists( $class, $method ) when the $class does effectively not exist will result in a segmentation fault. I’ve added a fix that circumvents this bug and released version 1.2.3.
Cheers