If you have blog rendering enabled for the site map, and you have anonymous blog posts, the username display is "'s blog", as uid 0 (the anonymous account) has no name.

I can think of two ways to solve this: we hit the Drupal site info settings for the Anonymous account name, or we display blogs only if uid > 0 (we make the SQL query's WHERE clause "WHERE u.uid > 0 AND n.type = 'blog' AND n.status = 1").

Comments

hackwater’s picture

Version: 5.x-1.1 » master
Component: User interface » Code
Assigned: Unassigned » hackwater
Status: Active » Needs review
StatusFileSize
new3.78 KB

Fixed this bug by changing array("!s" => $account->name) to array("!s" => $account->name ? $account->name : variable_get("anonymous", t("Anonymous"))), which accounts for an anonymous blog. I fixed this in HEAD, but tested only on 5.x-1.1 (the blog code is identical across those two versions).

I then proceeded to add options to the blog settings: one to leave the anonymous blogs question to the user (whether or not to display the anonymous user blog is up to them) and another to add a more useful blog listing (sorted by most posts).

freephile’s picture

I've seen this patch in action, and it does fix the anonymous user blog entry in the sitemap. Also, I like the ability it provides in the administration of the sitemap module.

frjo’s picture

Assigned: hackwater » frjo
Category: bug » feature
Status: Needs review » Needs work

Interesting feature.

Can you please redo your patch against HEAD, I can not get it to apply cleanly and it's not in unified format (cvs diff -up).

http://drupal.org/patch/create

hackwater’s picture

StatusFileSize
new5.51 KB

Sorry about that. Here's the patch using cvs diff -up. The admin menu settings were still in the .module file in HEAD when I created the first patch, so I moved those changes to the new .inc file.

hackwater’s picture

Status: Needs work » Needs review
hackwater’s picture

Category: feature » bug
Status: Needs review » Reviewed & tested by the community

Boy, was I ever wrong about this. The problem nagged at me until I did more checking. It looks like this problem originates in the blog module; I've posted a question about how anonymous blogs should be handled there (http://drupal.org/node/224109).

So my bug report + fix is going away until I hear how they want to handle it in the blog module; I'll update my feature request, and post the updated patch soon.

hackwater’s picture

Title: Blogs by anonymous users display incorrectly » Display more blog authors and their total number of blog posts
Category: bug » feature
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new4.87 KB

This patch adds the ability for the user to choose between displaying the first 10 blogs on a site (the original behavior) or display all blogs on a site, in descending order of total blog entries (total blog entries are displayed next to the blog name).

frjo’s picture

Status: Needs review » Closed (won't fix)