I am hopefully proposing a more efficient way to bulk update paths. I recommend this because of performance. Our site had to rewrite 1250 aliases because I wanted to change the path settings on a content type with only 30 nodes.

I would like to add a checkbox under each content type, user, or category path setting to provide the option to update only the selected paths. The following would only update paths for content_type_y:

Home > Administer > Site configuration

Pathauto

Pattern for all content_type_x paths:
[dir/x]
[ ] Bulk update content_type_x paths

Pattern for all content_type_y paths:
[dir/y]
[X] Bulk update content_type_y paths

Pattern for all content_type_z paths:
[dir/z]
[ ] Bulk update content_type_z paths

[ ] Bulk update all node paths

Another option would be to check if the path settings match the previous path settings on submit.

Comments

greggles’s picture

Version: 5.x-2.x-dev » 6.x-1.x-dev
Status: Active » Postponed

Pathauto already does the second thing you suggest (check that they are the same before making it) the problem is that all the performance heavy work happens during the "find the patterns for this node" stage which is before the comparison.

The first idea is, I believe, basically done though it has no UI. Bulk update in 5.x-2 no longer replaces aliases. Instead it updates aliases for objects which do not currently have aliases. So, if you want to replace aliases for a single content type you just delete the aliases for that content type.

For more details see: http://drupal.org/node/144904

I like your idea and see it as the eventual goal. But it's available now (with a little work) so I don't want to focus on it now. I'm marking it postponed and changing the version to reflect that situation.

robomalo’s picture

Many thanks for the following:

+ responding so soon
+ taking my idea into consideration
+ the module and the maintainers' hard work

greggles’s picture

robomalo - thank you for the well communicated idea!

Also, I assumed that your idea was a proposal for me to work on something. If you (or anyone else) wants to submit a patch that does this I would gladly review and commit it.

In re-reading it I see

"I would like to add a checkbox under each..."

and please don't let me prevent you from providing a patch if that is something you are capable of.

robomalo’s picture

I will try my hand at it as soon as my schedule clears up. (Hopefully on the clock!)

greggles’s picture

Title: Better way to update node paths with Pathauto » allow deletion of specific types of nodes (and vocabs? and roles?)
Status: Postponed » Active

Given that bulk update is now a two step process to rebuild aliases for a node type and given that we now have bulk deletes by object, the best way to implement this is as more specific checkboxes inside of pathauto_admin_delete() in pathauto.module

There's a small TODO list in there, so any of them that you want to tackle would be great.

robomalo’s picture

Version: 6.x-1.x-dev » 5.x-2.0-beta3
FileSize
9.34 KB

This post is regarding the delete aliases by node type feature on the pathauto to do list. Attached is a screenshot of my working version. As you can tell, node type alias counts are inconsistent with the rest of form.

If I split the form up into multiple fieldsets, make each node type option with a checkbox rather than all of them in checkboxes (using form api), then it could be made to look right.

robomalo’s picture

Here's the patch.

robomalo’s picture

Status: Active » Needs work
greggles’s picture

FileSize
2.95 KB

I took this a few steps further by reformatting the checkboxes, but there are still a few problems:

1) it doesn't currently actually delete anything
2) The count of nodes it deletes is too low. If we delete the alias for "node/23" we have to delete not just that but also "node/23/*" since other things can add on aliases like that. We have to be careful, of course, not to delete "node/23*" which could include "node/233".

So, the joins and conditions get a little complex. I'm starting to wonder if this is worth all the extra overhead/trouble.

There are some things in here that I did to clean up the code which I will be committing, though...

greggles’s picture

Version: 5.x-2.0-beta3 » 6.x-1.x-dev
Status: Needs work » Closed (won't fix)

I'm marking this as postponed against HEAD. I think this will need a refactoring of the url_alias table to add in some additional columns, but it may be a while before that happens, so...

In its current state, this is "won't fix".

greggles’s picture

Status: Closed (won't fix) » Active

If we do http://drupal.org/node/180440 then we can easily enable this kind of functionality. Yay!

greggles’s picture

Sadly when I got down to doing the work in that issue I realized that we will only know this information about pathauto created nodes...the rest of the url alias information would have to be determined by the alias which is possible, but not easy. I think the real solution for this problem will come in D7 timeframe... :(

robomalo’s picture

This is unfortunate, but that's the way of it. Either way, I greatly appreciate this module in its current state. Let me know if there is anything I can do to help in the future!

Dave Reid’s picture

Title: allow deletion of specific types of nodes (and vocabs? and roles?) » Allow updating specific subtypes of entities (node types, vocabularies, etc).
Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Postponed

Bumping to postponed for 6.x-2.x.

Dave Reid’s picture

Issue tags: +bulk

Tagging all the bulk alias issues for #713238: RFC: Pathauto Bulk module.

Dave Reid’s picture

Dave Reid’s picture

Title: Allow updating specific subtypes of entities (node types, vocabularies, etc). » Allow updating/deleting specific subtypes of entities (node types, vocabularies, etc).

Marked #418968: Delete by content type and taxonomy vocabulary as a duplicate of this issue.

mattcasey’s picture

I found this post because I have a related issue and want to share my workaround:
Sometimes deleting aliases is necessary. For instance if I alter a taxonomy term and want to update the node types that have this term in their alias pattern, I have to delete ALL content aliases first, then do a 'bulk update.' Even though I have "Create a new alias. Delete the old alias." checked, simply changing a taxonomy term does not trigger an update.

Why deleting all node aliases is an issue for me:
I often have different Menu blocks in the sidebar for each section that depend on the path, so my pages have custom paths like "about/info" and "about/contact." If I want to clear the aliases for another node type, the blocks disappear when I reset all aliases because the pages return to "content/info" and "content/contact."

The workaround:
I am going to start using a custom taxonomy with terms for each site section, that way I can create a pattern for pages and pathauto can delete and update aliases in bulk, but still keep my page aliases intact.

Dave Reid’s picture

Component: Code » Bulk generation
Issue tags: -bulk
Mark_L6n’s picture

Is 'Deleting Aliases by Content Type' being worked on?
I don't know if I'm missing anything with i18n complexities, but it seems like you'd just need to select all NIDs of a given content type from the node table, and use that to delete rows from the url_alias table.
I'd be glad to work on that (given help, as I haven't submitted a patch before) if needed.

moniuch’s picture

I would like to chime in ask if 'Deleting Aliases by Content Type' could get a 7.x-1.x patch, please?

Countzero’s picture

Are there any news on this ? Should we rely on direct database manipulation to bulk delete aliases by node type ?

EDIT : You can easily do this with VBO and action 'Update node alias'. Not as handy as a module tab, but definitely easy.

webservant316’s picture

Issue summary: View changes

I would also like to request that these features be extended. The challenge is when aliases are based on token patterns and the patterns change WHILE also have custom aliases within the same context.

Three ideas to solve the problem.

1. The delete and update aliases functions ought to allow for the exact same granularity of content type targeting as the patterns page allows for, that is content type, taxonomy, blog, forum, etc.

2. The list aliases page ought to provide filters to also search for the exact same granularity as the patterns page, that is content type, taxonomy, blog, forum, etc.

3. The individual node edit alias ought to provide a check box to make an overridden alias permanent. The admin delete aliases page could then have a checkbox to honor or ignore the permanent aliases override checkbox when bulk deleting.

What do you think?

Actually advice here provide all I need https://www.drupal.org/node/1326928.

So maybe my 3 ideas are not needed.

aubjr_drupal’s picture

Since this may not ever get into the module for D7, the best way is Countzero's suggestion: Views Bulk Operations. Create a view with the VBO field (and node title?), filter by the content type you want to update, and execute the "update node alias" VBO after saving the view. Not as fast as the native UI for this module, but it does the job well enough.

Daniel_Rose’s picture

+1 this feature request. As I learn that I need to delete existing aliases, I'm wondering the same as everyone else here. Instead of just having "Files", "Content", "Taxonomy Terms, and "Users". It would be nice to break these groups down even further. For example, with "Content" section, it would be nice to be able to just choose "articles" or "basic pages", etc. I'm open to learn other options. Maybe I'm missing something.

Thanks. :)