I’m assuming you’re using a bbCode plugin of sorts? Which one? Are you using one on the forums as well?
Plrk you don’t need the buddypress-enable.php plugin anymore. It was a fix for the libxml issue. Disable that.
plrk noticed that with the bp enable bbpress plugin disabled that we lost usernames and avatars in group forums. This patch works for me with bp trunk and bbpress 1.0 in group forums.
https://trac.buddypress.org/ticket/848
Unfortunately, the patch does not work for me. I am however not running from the trunk, I am running 1.0.2. I suppose something differs that affects this issue…
ipstenu: no, I am not running any bbCode plugins.
I installed 1.0.2 and then the patch. That works as well. Perhaps the difference is in the bbpress versions. Are you running v1.0 or v1.0.1 of bbpress?
Burt was told via IRC that I am running 1.0.1 (as it says in my starting post).
However, we weren’t able to squash the bug. I am working on a “fulhack” (a Swedish programming term that is very useful – literally “ugly hack”) that will work around it.
The hack:
<?
// Fulhack for fixing obscure [p] bug: see
// https://buddypress.org/forums/topic/p-showing-up-in-group-forums-and-activity-with-bp-102-and-latest-phplibxml
function fulhack_for_fixing_p_bug($string) {
$string = preg_replace("#\[a href=\"([^<]+)\"\]([^<]+)\[/a\]#i", "<a href=\"\\1\" target=\"_blank\">\\2</a>", $string);
$string = str_replace("[p]", "<p>", $string);
$string = str_replace("[/p]", "</p>", $string);
$string = str_replace("[ol]", "<ol>", $string);
$string = str_replace("[/ol]", "</ol>", $string);
$string = str_replace("[ul]", "<ul>", $string);
$string = str_replace("[/ul]", "</ul>", $string);
$string = str_replace("[li]", "<li>", $string);
$string = str_replace("[/li]", "</li>", $string);
$string = str_replace("
", "<br />", $string);
return $string;
}
add_filter( 'bp_get_the_topic_post_content', 'fulhack_for_fixing_p_bug' );
?>
The regex is missing some slashes though… if someone needs help figuring the proper regex out, contact me (through writing a reply to this topic, par example) and I’ll give it to you.
I was just talking about this issue with jjj on irc. This bp helper plugin provides data that isn’t normally sent over to bp as well as escaping the html <> brackets. plrk is right. The patch only works in the forum templates not the topic templates. I can’t patch the topic templates because it’s not getting user id info without the bp helper plugin activated.
In 1.0.2 the support for the bbpress helper plugin was pulled out. This ticket: https://trac.buddypress.org/ticket/853 has the essentials for re-enabling the helper plugin support in 1.0.2.
I stuck the ticket’s attached code into bp-custom.php and it works from there fine. I don’t see any need to hack up a bunch of core files. This is going to be a temporary situation.
We need to still run the bbpress helper plugin and the support code in bp 1.0.2. Nothing is gonna work right otherwise.
My hack above should also go into a bp-custom.php (or similar), but I’d use Burt’s code snippet instead.
All I did was hunt down the filters and functions that used to be in bp to support the helper plugin. Let me know if I missed any spot. I tested activity and the group forums templates.
Which code snippet addresses this issue on bp 1.02 then as I am confused?
If you can post your final code Plrk I am happy to give that a try
EDIT – just tried adding Burt’s into my bp-custom.php (using 1.0.1) and got a white screen of death…