Notifications
Clear all

wpForo 1.x.x [Solved] Recent Posts Widget - Can't Disable "Display with Avatars" - Part 2 of 2 Issues Found

2 Posts
1 Users
0 Reactions
1,422 Views
Posts: 281
Topic starter
(@crisw)
Reputable Member
Joined: 6 years ago

Hi wpForo Team.

I just noticed these Issues on another new forum we are setting up, using the latest version of wpForo.

We use long titles on our topics and posts, so on the Widget Area, we have disabled the "Display Avatars" in our other forum (that other forum still uses the previous version of wpForo and has not been updated yet).

And so when I was setting this up on the new forum, with that same old wpForo widget settings, that's when I noticed these two issues.

I am creating two different topics on this so that if in case I find a fix, I can also contribute and update this post. Just thought I'd report it to the wpForo Team as well.

Here's how you can recreate the issue,

when I go to the wpForo Recent POSTS Widget,

#1) - and then I unclick the "Display with Avatar" box,

and then I click the "Save" button,

#2 - the "Display with Avatar" box, automatically gets checked, and it is saved as is.

So essentially, the result is, the "Display with Avatar" can't be disabled.

I'm attaching the screenshot below of these two steps.

 

Related:  "Recent Topics" Issue

1 Reply
Posts: 281
Topic starter
(@crisw)
Reputable Member
Joined: 6 years ago

This too has been manually fixed.  I think I found the setting that was causing the "Recent Posts Widget - Display Avatar" Issue, that automatically saves it to display the avatar.

It was - on the "$this->default_instance = array", the display_avatar was set to "true" on Line #582.

My fix was to change it to "false". (If it is set to "false", the user can enable and disable this anyway on the wpForo Widget area. To set it to "true" does not allow this Display Avatar to show or hide, it just shows. 🙂

THE CODE (Lines 574-585 ): (wpf-includes > functions-template.php file)

 private function init_local_vars(){
$this->default_instance = array(
'title' => 'Recent Posts',
'forumids' => array(),
'orderby' => 'created',
'order' => 'DESC',
'count' => 9,
'limit_per_topic' => 0,
'display_avatar' => true,
'forumids_filter' => false,
'current_forumid_filter' => false

 

WHAT I CHANGED (On Line #582) - (wpf-includes > functions-template.php file):

 private function init_local_vars(){
$this->default_instance = array(
'title' => 'Recent Posts',
'forumids' => array(),
'orderby' => 'created',
'order' => 'DESC',
'count' => 9,
'limit_per_topic' => 0,
'display_avatar' => false,
'forumids_filter' => false,
'current_forumid_filter' => false

 

It fixed these two issues, this one (The Recent Post and the Recent Topics) - but we have to change two different lines on the same file (wpf-includes > functions-template.php file).  

This type of manual "fix" is for those users (like me) who have long Forum Post Titles and would like to Disable the avatars ONLY on the Widget area.

I hope this helps. 🙂 

Screenshot of the fix: