Notifications
Clear all

Recent Topics and Recent Posts widgets both resulting in errors

5 Posts
2 Users
1 Reactions
71 Views
Posts: 3
Topic starter
(@filleben)
Active Member
Joined: 6 days ago

Hello,

I am unable to use the Recent Topics and Recent Posts widgets they both result in errors when setting up the widgets.

Here are all the errors I get when trying to set them up in the WordPress backend:

The "wpforo_recent_posts" block was affected by errors and may not function properly. Check the developer tools for more details.

There was an error. Cannot read properties of undefined (reading 'hasOwnProperty')

Here are the errors from the error.log:

Fatal error: Uncaught Error: Call to a member function tree()on null in/home/website-name/public_html/wp-content/plugins/wpforo/widgets/RecentPosts.php:266

Stack Trace

1. wpforo\widgets\RecentPosts->form(Array)/home/website-name/public_html/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php:578
2. WP_REST_Widget_Types_Controller->get_widget_form(Object(wpforo\widgets\RecentPosts), Array)/home/website-name/public_html/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php:517
3. WP_REST_Widget_Types_Controller->encode_form_data(Object(WP_REST_Request))/home/cxocommunities/public_html/wp-includes/rest-api/class-wp-rest-server.php:1292
4. WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wp/v2/widget-t...', Array, NULL)/home/website-name/public_html/wp-includes/rest-api/class-wp-rest-server.php:1125
5. WP_REST_Server->dispatch(Object(WP_REST_Request))/home/website-name/public_html/wp-includes/rest-api/class-wp-rest-server.php:439
6. /home/website-name in /home/website-name/public_html/wp-content/plugins/wpforo/widgets/RecentPosts.php on line 266

I get the same set of errors for both Recent Posts and Recent Topics.

I have reinstalled wp-foro and disabled all other plugins with no success.

Any help would be greatly appreciated

4 Replies
Sofy
Posts: 4843
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi,

We'll check and get back to you soon. 

Reply
Sofy
Posts: 4843
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi,

We don't find such an issue on your test websites. 

The errors should be caused by either other plugins or the active theme

Please deactivate the plugins/theme one by one and check after each deactivation to find the source of the problem.

Reply
Posts: 3
Topic starter
(@filleben)
Active Member
Joined: 6 days ago

Hello,

Thank you for the reply.

The errors still exist after deactivating themes and plugins.

I have done more testing and found out that the issue is not present on the main domain, it only seems to be affecting the subdomain.

Initially, the project was not supposed to be a network/multisite setup however the scope of the project changed, wpForo was originally installed on the main domain before also being activated on the subdomain.

Hopefully, this information helps get to the bottom of the problem.

Reply
Posts: 3
Topic starter
(@filleben)
Active Member
Joined: 6 days ago

Following up on my reply we have done some more testing.

We have installed the plugin on several sites within our network. On sites that share the same domain (e.g., subdomains like example.com/site1 and example.com/site2), we encounter the same issues with the recent posts and recent topics widgets. However, on network sites with different domains (e.g., example.com and anotherdomain.com), the widgets function correctly. This suggests that the issue arises when multiple network sites share the same domain.

Reply