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").
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | site_map_blog_options.patch | 4.87 KB | hackwater |
| #4 | site_map_blog_options.patch | 5.51 KB | hackwater |
| #1 | blog-option.patch | 3.78 KB | hackwater |
Comments
Comment #1
hackwater commentedFixed 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).
Comment #2
freephile commentedI'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.
Comment #3
frjo commentedInteresting 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
Comment #4
hackwater commentedSorry 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.
Comment #5
hackwater commentedComment #6
hackwater commentedBoy, 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.
Comment #7
hackwater commentedThis 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).
Comment #8
frjo commented