| Project: | Pathauto |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Ok, imagine this situation.
(1) You have 60 terms spread into 2 vocabularies... 1-50 = Vocab 1, 51-60 = Vocab 2
(2) You have no aliases defined yet
(3) There is no "global" term alias pattern
(4) There is no term alias pattern for Vocab 1
(5) There is a pattern for Vocab 2..
Ok, now you do a batch update for the first 50 aliases that need doing.
PathAuto picks the first 50 terms, in this case all from Vocab 1, and all 50 are skipped due to there being no pattern. No aliases are made.
You run it again...
PathAuto picks the first 50 terms which, again, are all from from Vocab 1 and, again, all 50 are skipped due to there being no pattern. No aliases are made.
This problem keeps going around and it seems the ONLY way to get the aliases for terms 51-60 is to set your default "per batch run" setting higher than default.
Any thoughts on how this could be circumvented?
Initial thought: Maybe have an optional field where you can specify a "starting" tid or nid (this problem could also happen to node's too if you have 50 of Type A and 10 of Type B and no pattern for Type A)?
Comments
#1
Ah yes...
There is some fancy code in the node bulk update so that it only selects terms from the node types which will get aliased...I guess that needs to be done for taxonomies too.
One workaround is to set the number of objects to update to 500 or 5000 or something so that you can get beyond Vocab1. Then set it back later if necessary.
The concept of starting ID is a good one and is another one to make bulk updates more scalable in general. Perhaps we should change this issue to be related to that?
While I respect the critical priority of this issue I don't have time to work on it now. If you or someone else can (either the fancy tid based solution or the more elegant "starting tid" solution) I'll be overjoyed to commit it.
#2
Ok...and a patch.
@nicholasThompson - can you review this? It worked for me in limited testing. The queries aren't optimal...but with the cast that was added recently that shouldn't be a big deal.
#3
re-roll
#4
Applied to 5.x and HEAD.
Thanks for pointing this out, nicholasThompson.
#5
yeah, that.
#6
I have noticed that pathauto never updates existing paths after a change to taxonomy. For example, if you have a blog category named "news" that was created before setting up pathauto, and then you go to the taxonomy page to resave that item, you will get an error.
#7
@mikeque can you please open a new bug report for that? This is about a rather different problem. Thanks.
#8
I can't get the patch to install on my 5.x-2.2 version. In the past I have usually been able to get patch files working. I'm running the following from the 'pathauto' module directory
[~/www/sites/all/modules/pathauto]# patch -u < 239770_3_bulk_generate_vocabs_more_than_max.patch
have tried without -u and with various values of -pN
Am I doing something wrong or is it this patch?
#9
@greggles: I will post it separately, once I can figure out how to repeat it. For some reason I am having trouble doing that, but I'll bang away in the taxonomy and pathauto settings until it emerges again.
I noticed on your blog that you were recently in Argentina. I live in Buenos Aires, so next time you are here you have an open invitation to come by and sip some mate. So glad you made it to the north, my favorite part of the country. Do you know any Drupal users here? if you want to respond offline: mikeque AT peep DOTT org.
#10
setting bulk alias to 9999 worked for me.
then revert it to 50 since it might cause resource strain.
#11
@dejbar - if patches don't work you could also try the latest 5.x-2.x-dev which has this code in it. The code has changed a lot since 5.x-2.2 so it's not surprising that the patch fails to apply. You can also try to apply the patch "manually".
@mikeque - sounds good. I _just_ left Buenos Aires yesterday :( Maybe in a year or two I'll be back! I think this is what you're looking for: http://groups.drupal.org/argentina
#12
I guess you really want to make this an uphill battle, eh? ;)
This patch effectively rolled back an earlier commit of mine; I'll check in #261244: Eliminate Coder warning: "Use ANSI standard <> instead of !=" (pathauto_taxonomy.inc) to counter it...
#13
Automatically closed -- issue fixed for two weeks with no activity.