Links to topics in ...
 
Notifications
Clear all

wpForo 1.x.x [Solved] Links to topics in Hidden Forums appear on the "Recent Post" Widget, as viewed on Chrome

9 Posts
3 Users
5 Likes
994 Views
CrisW
Posts: 281
Topic starter
(@crisw)
Reputable Member
Joined: 4 years ago

Hi wpForo Support Team.  I'm submitting this bug report with a "possible solution" below.

-------------------------  

ISSUE: Links to topics in Hidden Forums appear on the "Recent Post" Widget, as viewed on Chrome

LOCATION /FORUM LAYOUT: Main Forum Page, Recent Post Widget Area, Threaded Layout

DESCRIPTION: We were testing the Threaded Layout and the "Hidden Forums and Hidden Topics".  On the "Recent Topics" menu located on the Forum Menu top bar, using the short code

/%wpforo-recent%/

All is well on the "Recent Posts" area of the hidden topics not showing, but on the Recent Post widget, the links to the hidden topics appear.  And when you click any of the links to the private posts, it goes to a 404 page. 

Attaching screenshot of my Recent Post Widget settings.

 

8 Replies
CrisW
Posts: 281
Topic starter
(@crisw)
Reputable Member
Joined: 4 years ago

Attaching screenshot of Registered Member View

 

CrisW
Posts: 281
Topic starter
(@crisw)
Reputable Member
Joined: 4 years ago

Attaching screenshot of Guest View with Links to Hidden Topics showing on the Recent Topics Widget (of course the entire posts remain hidden and do not appear, it's just the link to the post)

I'm not certain if this is a real issue, because some other forums show the "recent topics" and then it goes to "You have to be registered or logged in to view this page." to encourage people to Register or join the forum.
 
But now I do understand how this might pose as an issue to forum users who are responding, and thinking that their responses are not public.

I did a code tweak today (which I am including below), but out of respect to wpForo Support Team, please check it too, because I don't want my suggestion to break some other functionality on the forum codes.  So I'm submitting this FORMAT of submitting a Bug Report to make it easier for the Developers to recreate the scenario, and then do what you do best.  🙂

If it's wrong, please just delete this thread.  Thanks!  

CrisW
Posts: 281
Topic starter
(@crisw)
Reputable Member
Joined: 4 years ago

After I have used the code tweak below, this is a screenshot of what appears.

 

CrisW
Posts: 281
Topic starter
(@crisw)
Reputable Member
Joined: 4 years ago

Hi @Robert and @Sofy, Please correct me if I am wrong, let me know if this is okay to use which will not affect other functionalities in wpForo.  It's what I tweaked in my forum 🙂

The code I changed is in the wpforo/wpf-includes/functions-template

--------------- 610 - 621, specifically line 620

		$ug_can_va = WPF()->perm->usergroup_can('va');
$is_avatar = wpforo_feature('avatars');
$posts_args = array(
'forumids' => ( $instance['forumids'] ? $instance['forumids'] : $this->default_instance['forumids'] ),
'orderby' => ( key_exists( $instance['orderby'], $this->orderby_fields ) ? $instance['orderby'] : $this->default_instance['orderby'] ),
'order' => ( key_exists( $instance['order'], $this->order_fields ) ? $instance['order'] : $this->default_instance['order'] ),
'row_count' => ( ( $count = intval( $instance['count'] ) ) ? $count : $this->default_instance['count'] ),
'limit_per_topic' => ( ( $limit = intval( $instance['limit_per_topic'] ) ) ? $limit : $this->default_instance['limit_per_topic'] ),
'private' => $private,
'status' => $status,
'check_private' => false
);

--------------- Line 620

'check_private' => false

I changed it to >'check_private' => true;
 

$is_avatar = wpforo_feature('avatars');
$posts_args = array(
'forumids' => ( $instance['forumids'] ? $instance['forumids'] : $this->default_instance['forumids'] ),
'orderby' => ( key_exists( $instance['orderby'], $this->orderby_fields ) ? $instance['orderby'] : $this->default_instance['orderby'] ),
'order' => ( key_exists( $instance['order'], $this->order_fields ) ? $instance['order'] : $this->default_instance['order'] ),
'row_count' => ( ( $count = intval( $instance['count'] ) ) ? $count : $this->default_instance['count'] ),
'limit_per_topic' => ( ( $limit = intval( $instance['limit_per_topic'] ) ) ? $limit : $this->default_instance['limit_per_topic'] ),
'private' => $private,
'status' => $status,
'check_private' => true
);

--------------------

And in case this is wrong, or if it might conflict with other codes on the forum, please kindly just delete this thread so no one else can use it by mistake. (it seems to have worked though, in my forum) .  Thanks!   🙂  

4 Replies
Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9321

Thank you for the report and the detailed information. We'll fix this in next version for sure.

CrisW
(@crisw)
Joined: 4 years ago

Reputable Member
Posts: 281

Hi @Robert - Thank you for responding and confirming the code tweak is okay to use.  I am marking this post as "Solved" but only you can close it.  😎 (And by the way, congratulations!  wpForo has a new 5 Star Review over at WordPress!  You guys should get more because you really deserve it!  (I even updated my Signature!  So people will remember to CLICK to give wpForo 5 Stars! 🤩

ice
 ice
(@ice)
Joined: 4 years ago

Eminent Member
Posts: 26

Thanks for this @crisw . I tried it and it worked and so far nothing seems to be broken but for anyone that wants to try this just make sure you clear all wpforo caches after making the change.

At least this should suffice until the official fix from the plugin devs

CrisW
(@crisw)
Joined: 4 years ago

Reputable Member
Posts: 281

@ice - Thank you for confirming that the code tweak is working for you too. (At least there's one person that the code tweak has helped thus far, that was my intention for posting that detailed bug report above, in case the wpForo Team okays it, maybe it can also help other Admins who use wpForo).   🙂 

Share: