By default the users blog page (blog/uid) is set to "My blog" in the hook_menu.
But this title is never showing up on the blog page of a user because in the function blog_page_user($account) the title is explicitly set to "username's blog". This is true even if the current user is viewing his own blog page.
To avoid this, the title in blog_page_user should only be set to "username's blog" if the current user is viewing a blog page of an other user.
So in the function blog_page_user we should change
drupal_set_title($title = t("@name's blog", array('@name' => format_username($account))), PASS_THROUGH);
to
if ($account->uid <> $user->uid) {
drupal_set_title($title = t("@name's blog", array('@name' => format_username($account))), PASS_THROUGH);
}
Comments
Comment #1
furamag commentedI have checked Drupal 6 functionality and I have same title "username's blog" on page blog/uid . Are you sure this issue is bug?
When I'm using your code I have following error:
I think we should replace
to
Comment #2
smitty commentedWell I think this is the same bug as in D5 and D6. But nonetheless it seems a bug to me, even if it's an old bug.
The error you mentioned might occur because the menu system changed since D5 (I really did the change in D5 ant there it works fine.
I think your code is ok.
Comment #3
marcingy commentedThis is still an issue in head - bumping to d8. Will take a look at this. Moving to a task as it is more a wtf rather than a true bug.
Comment #4
marcingy commentedAmends logic for both the blog page and the blog feed page.
Comment #5
joachim commented+1 to this.
A few tweaks needed to the patch however.
Should we really be changing hook_menu?
Whitespace :/
I don't understand what the else part is doing here. Ohhh wait I get it -- you're falling back to what is set in hook_menu.
I don't think this is a good idea -- you're defining the title in two places that are miles apart in the code.
Should be "user's".
10 days to next Drupal core point release.
Comment #6
marcingy commentedReroll taking into account comments above.
Comment #7
deekayen commented#233301-125: Remove blog module from core removed blog from core.
Comment #8
nevergoneOutdated issue.