Notifications
Clear all

[Solved] UM Integration - Replace Profile & Memory Cache conflict

9 Posts
2 Users
1 Likes
4,420 Views
Posts: 11
Topic starter
(@themofella)
Active Member
Joined: 6 years ago

OK. So finally I have managed to find a solution to the issue I reported earlier i.e. that profile link within the topic/reply section for logged in user takes users to the wpforo profile page instead of UM profile page. This is because of how the profile link is accessed within the post.php file.

This can be fixed easily (although I think it needs to be fixed in the official release as it is possibly a bug) by adding a line to the post.php through a theme override as follows. Find the following piece of code...

    foreach($posts as $key => $post) : ?>
        <?php $member = wpforo_member($post); $post_url = wpforo_post($post['postid'],'url'); ?>
        <div id="post-<?php echo intval($post['postid']) ?>" class="post-wrap wpfn-<?php echo ($key+1); ?><?php if( $post['is_first_post'] ) echo ' wpfp-first' ?>">
... and inject the following line after the wpforo_member call...
        <?php $member['profile_url'] = esc_url(WPF()->member->profile_url($member)); ?>
... to have a final code which reads as below:
    foreach($posts as $key => $post) : ?>
        <?php $member = wpforo_member($post); $post_url = wpforo_post($post['postid'],'url'); ?>
        <?php $member['profile_url'] = esc_url(WPF()->member->profile_url($member)); ?>
        <div id="post-<?php echo intval($post['postid']) ?>" class="post-wrap wpfn-<?php echo ($key+1); ?><?php if( $post['is_first_post'] ) echo ' wpfp-first' ?>">
 
It will be great if this can be fixed in the official release. However if this is likely to break something else then can please someone shout. So far I have not seen any issues occuring as a result of this fix.
Posts: 393
(@anonymous3542)
Honorable Member
Joined: 7 years ago

@themofella thanks for the extensive response. I  seem to be able to replicate this issue on either of my two sites that both use wpForo and UM together as you've reported: 

Conclusion 1 - Logged in users are taken to the wpForo profile page when they click on their own link, while they are taken to the UM profile of other members. Is this meant to be the expected behaviour?

Very strange - can't say I noticed this before, but after trying to replicate your steps, it seems that this a bug.

Posts: 11
Topic starter
(@themofella)
Active Member
Joined: 6 years ago

Hi @anonymous3542,

Yes, it does look like a bug. I have gone in and updated several templates i.e. post.php, forum.php, topic.php and recent.php to address this. Ideally, it would be good to fix the wpforo_member_link() function in functions-template.php to include the following at the very start:

$member['profile_url'] = esc_url(WPF()->member->profile_url($member));
Page 2 / 2