Path auto bulk update broken with i18n
| Project: | Pathauto |
| Version: | 6.x-1.2 |
| Component: | I18n stuff |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
I upgraded to the latest version yesterday (not sure if it's related though), and when I today needed to change some alias settings and update all nodes of a certain type, this happens:
* I select all nodes I want to update (on admin/content/node). I select Update URL alias in the Operations dropdown, and save. Result -> Alias is deleted on all selected nodes, setting them back to node/nid!
* I select all nodes again, thinking that this time new aliases will be created, since they at this time don't have an alias. Hit save, and nothing happens. All nodes still have no alias.
When I go and edit each one of these nodes, I have to select Automatic Alias, which is unchecked, after which a new alias is created when saved.
How do I bulk update a bunch of nodes aliases? I'd really hate to go in and edit 1200 nodes manually...

#1
What if you go to admin/build/path/pathauto and under "Node path settings" check the "Bulk generate aliases for nodes that are not aliased" checkbox? Be sure to check the alias patterns are correct for your various content types before you hit save configuration.
That is how I've been doing my bulk alias updates, which is working fine in both 6.x-1.2 and 6.x-2.x.
#2
Nope, no aliases created that way either...
#3
subscribe
bulk update does not work with my installation either. got a blank page...
am running D6.14 + i18n-6.x-1.1 + cck-6.x-2.5 + Token-6.x-1.12 +...
#4
The problem is that the node language isnt passed to the "pathauto_create_alias" function when do a bulk update path alias.
6.x-1.1 has the same problem.
Here is a patch that resolves the issue (for 6.x-1.2)
#5
#6
Will this also work on sites that do not use locales? Is this a duplicate of any other issues in the queue?
#7
Hi anon and greggles,
thanks for the quick patch.
Unfortunately it does not work in my case. The behavior is very much the same and I get a blank page after waiting several seconds.
Thanks again,
univac
#8
Blank page means you ran out of memory. Try increasing your php.ini memory_limit value (search for details on how to do this - it is called a WSOD).
#9
@greggles - I don't see how this would affect sites without i18n needs, but I haven't tried it. This issue solves the bulk updating to work for i18n enabled sites, I can't see any other issues that does that.
The patch in #4 solves the issue I had, because without
$node->language, pathauto_create_alias() will always resolve to using no language dependent patterns. See this snippet from pathauto_create_alias():<?phpif (!empty($type)) {
$pattern = trim(variable_get('pathauto_'. $module .'_'. $type .'_'. $language .'_pattern', ''));
if (empty($pattern)) {
$pattern = trim(variable_get('pathauto_'. $module .'_'. $type .'_pattern', ''));
}
}
if (empty($pattern)) {
$pattern = trim(variable_get('pathauto_'. $module .'_pattern', ''));
}
?>
#10
@greggles
thanks for you prompt reply.
I use 128M as php memory limit, which is quite a lot. I have even raised to 512M for testing purpose, but with no luck.
Moreover I have really a few nodes in my testing environment.
By the way, the creation of single aliases works fine.
Thanks again,
univac
UPDATE: I have the very same problem with Path module. I have created an issue under the latter project.
#11
I deleted all users aliases and I want to bulk generate new aliases. But it do not work. It says "Bulk generation of users completed, 0 aliases generated." now none users have one.
#12
#11 describes my problem exactly. I was trying to change the way that paths were auto-generated for users, and so I deleted all existing aliases. Creating the new aliases does not work.
#13
hi
i have the same problem
I downgrade to 6.x.-1.1 end this problem dose exist
#14
I've moved this back to work as it isn't fixed and downgrading to a previous version is not a fix, although I can confirm that even downgrading doesn't fix the problem.
Just to confirm this is the issue.
I deleted all my taxonomy aliases (about 1200).
I then tried to use the bulk setting feature to recreated them. I am doing 200 at a time so memory is not a problem.
I get the following message
* The configuration options have been saved.* Bulk generation of terms completed, 0 aliases generated.
I tried the patch and it does not fix the problem. I even checked the database table url_alias and nothing.
And I maybe wrong about this, but it isn't an internationalisation problem as its all in English.
#15
subscribe
#16
OK guys, I've solved this problem for me. (#14, #11 and several others including parent)
Go to
admin/build/path/pathauto-> "automated alias settings" -> "General Settings"and change the "Update Actions:" settings to "Create a new alias. Delete the old alias." (Mine was set to "Do nothing. Leave the old alias intact")
Then when I use the bulk update it worked.
I'm moving this to fixed as the following issues deal with the problem of the "Do nothing...." setting:
#478718: Update action "do nothing" should do more...
#285042: Bulk Update + "Do Nothing" Should Still create aliases for unaliased items
#17
#18
#639512: Massgeneration of aliases creates only 50 links!? What's about the other 120.000 aliases? seems to be a follow up. I haven't found any batch API/cron stuff in the module so I expect that this bulk update doesn't work reliable. Aside - I need to update 120.000-180.000 aliases.
#19
Ok, we have several different issues here. My post (#1) was regarding updating aliases on a multilingual site.
My issue is fixed with the patch in #4. That patch has nothing to do with some of the other issues here.
Other people here has taken over the issue with other problems with bulk updating etc.
@hass (#18) - use the Views bulk operations module if you can. It uses the Batch API.
#20
OT: This bug have nothing to do with Views.
#21
@hass - I know. I was just suggesting a solution if you need it right now.
#22
I also have the problem of URL aliases not being generated on a multilingual web site, after deletion of aliases.
The patch in #4, does not solve the problem, sadly...