Issue confirmed, will see if this is a valid fix, thanks for your timelúthien wrote:I came across the same issue, and because I really wanted to integrate the login of a phpbb & wordpress site - and because this extension seems to be the only one that can do this trick for PHPBB 3.1.6 - I had a closer look. I'm down with a heavy cold anyway, so this seems like a great way to get through the dayivanovvla wrote:PHP Fatal error: Class 'WP_Roles' not found in /Volumes/Users/viva/Sites/wpbase/forums/ext/wardormeur/phpbbwpunicorn/acp/phpbbwpunicorn_module.php on line 166
I did a bit of debugging, and though I first thought that putting the Wordpress site on the same level as PHPBB might help - it didn't. Because I'm not yet very familiar with the PHP frameworks used here (composer etc.) I might be doing some really bad things here, so I'm merely posting it for entertainment purposes - please don't copy any of this.
I'm working with a completely empty / vanilla PHPBB & WP installation on localhost just to try stuff out.
Anyhow, the problem seems to be that the composer ClassLoader.php used by this plugin cannot find the WP_Role and WP_Roles classes. They live in the (worpress_directory) / wp_includes / class-wp-role.php & class-wp-roles.php files respectively, and for some reason that mechanism that is supposed to scan the Wordpress installation for these classes doesn't look in the right places.
I found that adding two lines to the file <forum_root>/ext/wardormeur/phpbbwpunicorn/acp/phpbbwpunicorn_module.php, after line 46:
so that it reads
Code: Select all
results in the PhpbbWPUnicorn Settings tab appearing, with all the Manual Role Associations - I'll play around with that and see how far I get.
Code: Select all
require_once($this->config['phpbbwpunicorn_wp_path'].'/wp-includes/general-template.'.$phpEx); require_once($this->config['phpbbwpunicorn_wp_path'].'/wp-includes/class-wp-role.'.$phpEx); require_once($this->config['phpbbwpunicorn_wp_path'].'/wp-includes/class-wp-roles.'.$phpEx);
The advantage of all this is that I learn a lot about how these extensions are made ...