I love this module. Question though:

Is it possible to bulk create redirects on bulk alias deletion and creation? Meaning: I have pathauto going, and I need to change the automatic alias settings. Further, I want to overwrite the old aliases with the new ones, which is possible to do in pathauto by deleting all the old aliases, and then bulk generating new ones. However, this leaves the problem that there are no redirects created from the old aliases to the bulk-generated new ones. Is there any way to achieve that? It seems like it would be very useful in allowing bulk pathauto changes.

Thanks!

Comments

silentway’s picture

Yes, this would great. Is it possible?

I tried using the extra functions that the Views Bulk Operations module gives us. But I couldn't get it to work as davidlerin described above. Check it out: when Views Bulk Operations and Path Redirect are both installed, set up a view with the Bulk Operations style. The Bulk Edit: Style options shows these options:
Redirect to a tokenized URL (token_actions_goto_action)
Redirect to URL (system_goto_action)

But views (and VBO) works on nodes, not aliases. I can't find a way to bulk change a bunch of aliases. The best would be an option in admin/build/path/list to select a bunch of aliases, and then change the selected aliases into redirects. First we'd have to create a view that lists aliases... but then what?

Anyone have ideas?

protoplasm’s picture

I installed the path redirect module because this is what I thought it did. I am now realizing that either I am doing something wrong, misunderstanding something, or else 'Create a new alias. Redirect from old alias' doesn't really work.' I can bulk create new aliases, but I can't bulk create a new alias while creating a redirect from the old alias which is the option that path redirect adds to pathauto. It only works if you delete the alias first. So this option seems to me like a non-option or one that isn't working or I am not doing something correctly. Since the bulk update says: "Bulk generate aliases for nodes that are not aliased Generate aliases for all existing nodes which do not already have aliases," I suspect that something is amiss here. Can someone please explain to me either how to get this feature working or what I am doing wrong. Thanks! I have 10,000 node aliases alone that I am trying to optimize and deleting is not an option.

Definitely looking for a way to bulk create aliases and redirect old ones.

silentway’s picture

I found a workaround... maybe. It was a few weeks ago in a flurry of work and I didn't document it very well. My notes follow, but a caveat: this might not actually be a fix for this exact problem but it'll at least spur some ideas. Please double-check me and report back here! My notes:

Fixed alias messiness to fix the menu problem wherein some menus pointed to old aliases, some to new. Solution: Manually delete old aliases in the db. Best way to do this in bulk is via PHPMyAdmin. (It's OK to delete aliases in the db via PHPMyAdmin, it's in table url_alias.) Then set pathauto/pathredirect to replace old aliases with redirects. Then bulk-update paths via VBO view.

Here's the SQL to see a list of certain aliases:
SELECT * FROM `url_alias` WHERE src NOT LIKE 'taxonomy%' ORDER BY `url_alias`.`src` ASC LIMIT 0 , 300

to filter out content types, add this to the statement:
AND dst NOT LIKE 'contenttype/%' etc...

Note: once a redirect is created for a node, the old url won't show in the alias table, it'll be in table path_redirect.

bleen’s picture

Looking for the same ... subscribing

bleen’s picture

I'm still experimenting, but i spoke with greggles and davereid on IRC today and they both confirmed that using Views Bulk Edit and the Update URL Aliases does the trick (as long as you have "redirect to new alias" set in your path auto settings)

silentway’s picture

OK, so it seems the OP's issue may be addressed by VBO's "update path alias" operation. (#5 mentioned " Update URL Aliases" but did you mean "update path alias"?)

Is that confirmed?

But as I understand it (and this may be venturing out of the Path Redirect issue queue), you can create a view that lists nodes. But you can't create a view that lists aliases. So (using VBO's "update path alias" operation on a bunch of nodes) you can't review which aliases you're working on, and you can't manually deselect aliases.

And in admin/build/path/list, you can't do anything in bulk.

Particularly tricky if a node has multiple aliases. It's all or nothing, and you're flying blind.

bleen’s picture

RE #6 ... yes I meant "Update path alias" and yes, this is confirmed.

The rest of the concerns you bring up are both interesting and valid, though I have no idea what issue queue this would really fall under. It seems that we may need a new module all together to create views of node aliases ... I'm not familiar enough to know if anything like that exists already

Interesting.

dave reid’s picture

How about we add path.module support for joins against {url_alias} so we could make a views bulk operations for unaliased nodes?

dave reid’s picture

Status: Fixed » Closed (fixed)

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