Quantcast
Channel: Topic Tag: error 500 | WordPress.org
Viewing all articles
Browse latest Browse all 1704

estepix on "[Plugin: BuddyPress Wall] Error 500 when opening an activity link like /activity/p/206/"

$
0
0

Hi all,

Buddypress Wall v0.9.4

I'm having the same error described in https://wordpress.org/support/topic/members-directory-posts?replies=1
when clicking an activity link, like the time next to every activity post I get:

Fatal error: require_once(): Failed opening required '.../wp-content/plugins/buddypress-wall/includes/templates/bp-default/members/single/activity/permalink.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/gaypoint.local/wp-includes/template.php on line 555

The problem is that the plugin tries to open a file that does not exist:

wp-content/plugins/buddypress-wall/includes/templates/bp-default/members/single/activity/permalink.php

The origin of the problem is on file:
wp-content/plugins/buddypress-wall/includes/bp-wall-screens.php

Line 91:

add_filter( 'bp_located_template', 'bp_wall_load_template_filter', 10, 2 );

This filter allows the plugin to replace standard buddypress templates with "wall" templates, it works ok for 'members/single/home-wall.php', 'activity/index-wall.php' and 'groups/single/home-wall.php' but not for others like 'members/single/activity/permalink.php'

These lines 77-83 seem to be the problem:

foreach ( (array) $templates as $template ) {

		if ( file_exists( STYLESHEETPATH . '/' . $template ) )
			$filtered_templates[] = STYLESHEETPATH . '/' . $template;
		else
			$filtered_templates[] = dirname( __FILE__ ) . $templates_dir . $template;
	}

Basically if the template is located in the STYLESHEETPATH, then this will be loaded, otherwise they will be loaded from the plugin path. The problem arises when using a child theme (as it is my case) which does not have the permalink.php template, therefore buddypress-wall tries to load the file buddypress-wall/includes/templates/bp-default/members/single/activity/permalink.php

A quick workaround is to copy permalink.php to our child theme path:
wp-content/themes/child-theme/members/single/activity/permalink.php

However to fix this properly, the code should look up the templates in the following locations and order:

  • wp-content/themes/child-theme/members/single/activity/permalink.php
  • wp-content/themes/parent-theme/members/single/activity/permalink.php
  • wp-content/plugins/buddypress-wall/includes/templates/bp-default/members/single/activity/permalink.php
  • wp-content/plugins/buddypress/bp-themes/bp-default/members/single/activity/permalink.php

meg@info, please let me know if you need any help with this.

Regards,
Oscar

https://wordpress.org/plugins/buddypress-wall/


Viewing all articles
Browse latest Browse all 1704

Trending Articles