When the 'Update Action' is set to 'Create a new alias, replacing the old one', it seems that a bulk update should overwrite old aliases with new aliases. However, a bulk update will only generate aliases for nodes which do not already have one. So if my nodes already have aliases, and I change the pathauto format and make a bulk update, no new aliases are created. Seems like the 'replacing the old one' isn't working...

Is this a bug or feature request?

I'm running Drupal 5.2, Pathauto 5.x-2.0-beta2, Token 5.x-1.8.

A workaround was to go into pathauto_node.inc, and change:
$query = "SELECT nid, type, title, uid, created, src, dst, vid FROM {node} LEFT JOIN {url_alias} ON CONCAT('node/', nid) = src WHERE src IS NULL";
to:
$query = "SELECT nid, type, title, uid, created, src, dst, vid FROM {node} LEFT JOIN {url_alias} ON CONCAT('node/', nid) = src";

But I prefer not to tamper with source code. Thanks!

CommentFileSizeAuthor
#2 pathauto 5.x-2.0-beta3 features.txt2.49 KBellanylea
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Component: User interface » Documentation
Category: bug » task

This is "by design" in the new version. You can see the reasons why in the history (it has to do with bulk updating _really_large_ sites).

Please note that there is also a feature at admin/build/path/delete_bulk which allows you to delete aliases so that then

This needs some "upgrade" notes to advise people to how to do this. Could you possibly provide that?

ellanylea’s picture

I've edited this handbook page http://drupal.org/node/144904 to clarify the new Pathauto features. Txt attached, I have .doc with formatting...

greggles’s picture

This is great - thank you!

It's hard to see what your changes were - can you provide it as a "diff" or perhaps just post the text that you added? If you want to edit it directly (and edit the handbooks in general) then you could join the documentation team

Thanks again.

ellanylea’s picture

Version: 5.x-2.0-beta2 » 5.x-2.0-beta3

It would be great to edit the handbook page directly. Been wanting to do that for a while, what better time to start. My user ID number is 95556. Thx!

greggles’s picture

I can't do it myself - you'll need to follow the instructions on that link I sent to the "join the documentation team" stuff...

mshaver’s picture

It's too bad this feature has been eliminated from Pathauto. I understand some of the issues, but there are many situations where this becomes problematic. I'll explain:

I have a pathauto url set for a node type, but create content with other node types and enter custom url aliases that are similar to the pathauto url. Since you can only delete the entire "content" aliases, it would delete both of these. Selecting the "Bulk generate aliases for nodes that are not aliased" will only restore those aliases set in pathauto. You will then loose all your custom url aliases.

Deleting the aliases from the database is an option, but you have to run complicated sql joins to get only the content type with a particular alias.

If we could customize the "pathauto_admin_delete" function to delete only url aliases from a particular content type, it would help a lot. My PHP skills aren't quite up to this! Anyone out there interested in this?

greggles’s picture

Well, it's a choice between one kind of problem and another.

I felt that providing a scalable bulk update solution was more important than your situation. I guess we'll see which is more important, but I encourage you to watch the issue queue and read the old issues to try to weigh the importance of each side.

There is work to make the delete options more granular in http://drupal.org/node/151590 which robomalo keeps teasing me about having time to fix - you can subscribe to that if you want to get updates on it.

@AdAstra - any progress on getting approved as a docs maintainer?

greggles’s picture

Title: Overwrite old alias, even if alias already exists » document bulk generation and bulk deletion feature

changing title to be more descriptive

greggles’s picture

Status: Active » Fixed

@AdAstra - thanks, I've merged your changes into that document.

I also created the page here: http://groups.drupal.org/node/6706

ellanylea’s picture

Great, thanks! Sorry for the delay, I did get approved but was away for a while.

Thank you for maintaining this fabulous module so actively!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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