Skip to:
Content

Opened 9 years ago

Closed 8 years ago

#1972 closed defect (bug) (fixed)

Bug: Wrong blog title

Reported by: _DorsVenabili Owned by: apeatling
Milestone: 1.5 Priority: normal
Severity: Version: 1.2.6
Component: Core Keywords: blog, has-patch, needs-testing
Cc:

Description

I have installed the last trunk version of BP with WPMU 2.9.1.1.

When I create a new blog and I go to 'Custom Header' in 'Appearance' in that new blog, if I select 'Show text' and I save changes, it doesn't show the new blog's title, intead that it shows the default blog's title.

I have tried this creating in more than one blog and every time happens the same, cause every blog must to show their own title.

Attachments (1)

1972.001.patch (487 bytes) - added by r-a-y 8 years ago.

Download all attachments as: .zip

Change History (17)

#1 follow-up: @apeatling
9 years ago

  • Resolution set to invalid
  • Status changed from new to closed

This is a bug with the WordPress custom header API by the sounds of it. Please log this on the WordPress trac.

#2 in reply to: ↑ 1 @_DorsVenabili
9 years ago

Ok, thanks :)

#3 @_DorsVenabili
9 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

#4 @_DorsVenabili
9 years ago

I'm sorry Andy, but I have checked the problem and it's a buddypress's bug too, cause this happens beacuse there is an error in a function in:

wp-content/plugins/buddypress/bp-themes/bp-default/header.php

We can see in line 44:

<h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>

But that is wrong, cause the function bp_site_name() only shows the deafault blog's name.

#5 @_DorsVenabili
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

I've fixed it. In file: wp-content/plugins/buddypress/bp-themes/bp-default/header.php in line 44:

<?php global blog_id; ?>
<h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php echo blog_name($blog_id); ?></a></h1>

And we add the next function in functions.php

function blog_name($blogid){

global $wpdb;


$blogname = $wpdb->get_var("SELECT meta_value FROM wp_bp_user_blogs_blogmeta WHERE blog_id='".$blogid."' AND meta_key='name'");

return $blogname;

}

#6 @_DorsVenabili
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#7 @r-a-y
9 years ago

  • Milestone changed from 1.2 to 1.2.1

#8 @miguael
9 years ago

I think it could have something to do with this ticket: When I change the name of a blog in the backend it doesn't get changed in BP (buddybar, directories etc) It still shows the old name.

#9 @bewst
9 years ago

  • Component set to Activity

Well, it's still quite broken for me in BP 1.2.2.1

This simple patch seems to fix it:

--- header-old.php	2010-02-21 02:02:40.000000000 +0000
+++ header.php	2010-02-21 01:54:31.000000000 +0000
@@ -41,7 +41,7 @@

 		<div id="header">

-			<h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>
+			<h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bloginfo('name') ?></a></h1>

 			<ul id="nav">
 				<li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>

#10 @bewst
9 years ago

  • Component changed from Activity to Blogs
  • Owner set to apeatling
  • Status changed from reopened to assigned

Note that it also doesn't show the blog subtitle, even on the main blog (e.g. "just another XXX weblog"), and the background color seems to be locked to that of the BP default theme. See http://ryppl.techarcana.net for an example. This is using the "Bold Red" Darwin theme.

#11 @nig3d
9 years ago

I have fixed it in this way:

function bp_site_name() {

echo apply_filters( 'bp_site_name', get_blog_option( $GLOBALS->blog_id, 'blogname' ) );

}

it works for me.
This is my first contribute, so I don't dare to set as resolved.

#12 @nig3d
9 years ago

just a little comment. This function is rarely used, so if there is a more used alternative, I reckon it should be deleted.
Of course unless I misunderstood the bp_site_name meaning (maybe it is the name of the entire site and not of one specific blog, nevertheless looks pretty useless in the latest version of BP).

#13 @DJPaul
9 years ago

  • Keywords has-patch added
  • Priority changed from major to normal

#14 @DJPaul
8 years ago

  • Keywords needs-testing added; new title header custom removed

This needs to be confirmed against WP 3.0 and BP 1.2.6

#15 @r-a-y
8 years ago

  • Component changed from Blogs to Core
  • Version set to 1.2.6

I can confirm the OP's report.

Attached is a patch against v1.2.6.
Using get_bloginfo('name'), since we shouldn't stick to a multisite function for this.

@r-a-y
8 years ago

#16 @djpaul
8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [3503]) Correct links and site title when BP-Default is used on hosted sites in a multisite configuration. Fixes #1972, #2061, #2653.

Note: See TracTickets for help on using tickets.