Can you let me know if this works on your installation?
$args = array( 'post_types' => $post_types, 'taxonomies' => $taxonomies );
$roles = ppc_get_roles( 'user', $user->ID, $args );
That’s the effect you get with the compact function. array_merge() is not equivalent because it doesn’t set the keys.
Thanks for the response. I did realize shortly after posting that there were many differences between compact and array_merge, so my change didn’t really solve the issue.
Another fix I tried was to replace the $post_types and $taxonomy variables instead of compact.
$post_types = pp_get_enabled_post_types( array() );//, 'object' ); Defaults to 'names'
$taxonomies = pp_get_enabled_taxonomies( array() );//, 'object' ); Defaults to 'names'
...
$roles = ppc_get_roles( 'user', $user->ID, compact( $post_types, $taxonomies ) );
The site is currently using your code from above. It may just be the fact that the site does not have anything to show, but all three of these changes result in the same content on the edit users page as my previous installation on PHP, where the original code worked fine.
Also, there is a similar issue to this one on the Edit permission group page (/press-permit-core/admin/permissions-ui_pp.php). The same code is at line 516. For this one, however, your fix above did not work.
What do you mean by “similar issue” and “did not work”? You get the same fatal error in permissions-ui_pp.php, with or without applying the change I suggested today?
Yes, I do mean that the same fatal error occurred. The exact error is: “Fatal error: Object of class stdClass could not be converted to string in /wp-content/plugins/press-permit-core/admin/permissions-ui_pp.php on line 516”.
I attempted the change you suggested, changing the line to:
$roles = ppc_get_roles( $agent_type, $agent_id, array('post_types' => $post_types, 'taxonomies' => $taxonomies ) );
I was incorrect in my previous reply. I messed up the code. This change does correct the issue in the permissions ui file.
Thanks for your help with this. I know that this issue is limited in scope to only people using HHVM, but would these changes be present in future versions of the plugin? Just wondering so that I would know if I’ll have to make these changes for each updates.
Okay, so the code change does clear your error on both pages? I will include them in the next Press Permit Core version.
Yes, the change fixed the error on both pages. Thanks again for your help.