I've setup PathAuto for my custom content type as follows: customcontenttype/[yyyy]/[mm]/[dd]/[author-name-raw]/[title-raw]
I've also tried using the non raw version of author-name as the PathAuto: customcontenttype/[yyyy]/[mm]/[dd]/[author-name]/[title-raw]
But it still won't create a listing for anonymous. Instead Anonymous user posts are placed in: I've also tried using the non raw version of author-name as the PathAuto: customcontenttype/[yyyy]/[mm]/[dd]/[title-raw] (notice there is no [author-name]).

See also: http://drupal.org/node/586828

CommentFileSizeAuthor
#5 token_node.inc_.patch710 bytesChrisRut
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ChrisRut’s picture

Oops, I copy and pasted that line incorrect, it should be:
But it still won't create a listing for anonymous. Instead Anonymous user posts are placed in: "customcontenttype/[yyyy]/[mm]/[dd]/[title-raw]" (notice there is no [author-name]).

ChrisRut’s picture

Also wanted to point out...
I created a view similar to a blog:
Node: created year
Node: created month
Node: created day
User: Name
Arguments Screenshot

So "/2009/09/23/Administrator" will list all the nodes created by the Administrator on 9/23/09, and "/2009/09/23/" should list all the users who created nodes on 9/23/09, however there is a catch, if the node was created by an "Anonymous" user, there is no link.
Screenshot - Notice there is a listing for Administrator, and it looks like the administrator posted 3 nodes, and there is another user with NO TITLE who posted 1 (that is the Anonymous Post).
And when I go to the node manually, and I see it is located at "customcontenttype/[yyyy]/[mm]/[dd]/[title-raw]", notice there is no [author-name] in there.

ChrisRut’s picture

Status: Needs review » Active

The corresponding lines of code are: (grep -inr "author" .)

./token_node.inc:33:      $values['author-uid']       = $node->uid;
./token_node.inc:34:      $values['author-name']      = check_plain($account->name);
./token_node.inc:35:      $values['author-name-raw']  = $account->name;
./token_node.inc:36:      $values['author-mail']      = check_plain($account->mail);
./token_node.inc:37:      $values['author-mail-raw']  = $account->mail;

Would it be possible to add the following check:

if (empty($account->name)) {
$values['author-name']  = "Anonymous";
$values['author-name-raw'] = "Anonymous";
}
ChrisRut’s picture

:delete:

ChrisRut’s picture

Status: Active » Needs review
FileSize
710 bytes

See attached patch.
Worked for me.
Needs Review

ChrisRut’s picture

I also found another solution that works thanks to merlinofchaos on IRC: Simply change the MySQL DB table "users" where "UID" = 0 set "name" = Anonymous

Dave Reid’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.