This is and might sound a bit strange. But registering with a username: a resolves in a bug.

When the path for users is /members/username
Then the user with username a gets the following path /members

Comments

Michsk’s picture

when the path should be /members/a

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

I used the user profile pattern 'members/[user-raw]' and registered a new user on my site, and it worked just fine for me. Can you give this a try with the latest code and double check your URL alias patterns?

greggles’s picture

I think this is a "words to remove" problem because of the username "a."

I guess Pathauto should do something different if the only words in a string are words to remove?

Michsk’s picture

if i will find out more about this one i will post it.

greggles’s picture

Title: User with username: a generates no path » Paths can end up as empty strings, but Pathauto should insert a number (or something) instead
Status: Postponed (maintainer needs more info) » Active

Better title and marking #724894: characters are not changed nor working as a duplicate.

Freso’s picture

Version: 6.x-1.2 » 7.x-1.x-dev

Marked #727302: If node title contains only ignore words, it results to a blank alias as a duplicate. Also, I'm guessing this applies to 7.x-1.x as well.

arpeggio’s picture

I would like to suggest for the fix of this issue: Optionally we can left the alias untounched to avoid blank alias if component contains only the ignore words. Here's the suggestion fix for pathauto.inc starting line 183:

-  if (function_exists('mb_eregi_replace')) {
-    $output = mb_eregi_replace($ignore_re, '', $output);
+	// If element contains only the ignore words, left the alias untounched to avoid blank alias
+  if (function_exists('mb_eregi_replace')) {	
+	 $temp_output = trim(mb_eregi_replace($ignore_re, '', $output));
   }
   else {
-    $output = preg_replace("/$ignore_re/i", '', $output);
+	 $temp_output = trim(preg_replace("/$ignore_re/i", '', $output));
   }
+	$words = preg_replace('/ |' . $separator . '/', '', $temp_output);
+	if (strlen($words)) {
+	 $output = $temp_output;	
+	}
dave reid’s picture

I really like this idea of checking if the output will be an empty string, then don't use the replaced-word-output. This will need a test to confirm it works and stays working though.

arpeggio’s picture

Sure of course we need to test it. Although I made my own testing and it works fine but only for nodes. Others like taxonomy, user-tracker and user path I only assume their auto path routine work the same as nodes.

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new2.14 KB

Initial patch with small test for D7.

dave reid’s picture

Title: Paths can end up as empty strings, but Pathauto should insert a number (or something) instead » Prevent pathauto_cleanstring() from creating empty components

Better title

Michsk’s picture

when will this be back-ported to D6?

dave reid’s picture

After this gets reviewed and committed to Drupal 7.

Michsk’s picture

ok so i guess... come on, come on, come on!

greggles’s picture

I appreciate your enthusiasm, but the best thing to move it forward is a patch review.

dave reid’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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