Ticket #972 (closed defect: fixed)
Loading WordPress inside bbPress broken in several ways
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 1.0 |
| Component: | Integration | Version: | 1.0-rc-2 |
| Severity: | major | Keywords: | |
| Cc: |
Description (last modified by sambauers) (diff)
Loading WordPress inside bbPress has been possible in the past by "including" wp-blog-header.php inside bb-config.php
This ticket is meant to combine all the reported issues so far into one ticket, including:
- #965 - Integration results in Inactive User Accounts
- #837 - Unable to load WordPress functions into bbPress
New issues arising from loading WordPress inside bbPress can also be added here.
Change History
I tried to figure this on my own, but I didn't get very far. Though, I thought I should share my experiences.
In the first place, the login did not stay open so that I would be able to enter the admin menus of bbPress after loggin in to WP.
Doing these steps made it possible to keep the login from WordPress open when entering bbPress:
- bb-settings.php : Change the $bb->authcookie from "wordpress_" to "wordpress_logged_in_"
- pluggable.php : rename "wp_validate_auth_cookie" to "bb_wp_validate_auth_cookie" (rename all occurences in bbPress)
- class.wp-auth.php: remove the hmac hash check
Now I was able to log in to WP and stay logged in when entering bbPress. And even use /bb-admin/.
Next, I fixed the problem with role names in the forum in bb-includes/template-functions.php:
- change "@$caps = array_keys($user->capabilities);" to "@$caps = array_keys($user->bb_capabilities);"
This was the closest I got to making the integration work. The next step would be to be able to enter /bb-admin/ without getting returned to the home page.
I made it by uncommenting some redirect-functions, but I did however not have the caps to edit any info, more than a moderator. I figured it had to be the caps which are wrong.
So I checked the $bb_current_user variable, and it proved me correct. The ->allcaps does not show the caps from bb_press, but only from wordpress. It is also missing the role as keymaster, even though keymaster is one of the ->bb_capabilities.
You would probably have figured this on your own when you were trying to fix this bug, but I hope I might have provided som info to help you troubleshoot it :)
Thanks for the footwork svennid. It is very helpful.
comment:4
in reply to:
↑ 3
johnjamesjacoby — 3 years ago
I think problem is that the filters are added after WordPress has already loaded and processed the essential functions.
Example being that a filter for map_meta_cap is added to also call bb_map_meta_cap, but bb_map_meta_cap is never processed because WordPress is loaded first.
Unfortunately WordPress MUST be loaded first, as it's functions don't check for duplicates like bbPress does.
- Status changed from new to closed
- Resolution set to fixed
Calling this fixed. New issues in new tickets please!