Hi,
I had an issue with pathauto, some SQL syntax. When doing bulk updates if there is no category (taxonomy) present the bulk update failed (for categories). I created a patch, please review to make sure it's alright.
Thanks,
JG
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 286845_bulk_generate_no_objects_5x.patch | 5.3 KB | greggles |
| #10 | 286845_bulk_generate_no_objects_6x2.patch | 5.67 KB | greggles |
| #4 | 286845_bulk_generate_no_objects.patch | 6.14 KB | greggles |
| pathauto_taxonomy.patch | 681 bytes | jose.guevara |
Comments
Comment #1
greggles@joseguevara - yes, I've thought about this before. What is the error message you get?
Do you really have no taxonomies present or just none with a pattern and no default pattern?
Comment #2
jose.guevara commentedNone present, the taxonomy module is enabled but for that site I didn't need any taxonomy, I just used different content types and views.
The error message was:
Comment #3
NaX commentedThis patch fixed my problem. Still to be tested once I have some categories and terms.
My original post: http://drupal.org/node/289417
Comment #4
gregglesAnother idea I had is that if there are no objects to do a bulk generate then we shouldn't even show this box. But...we should still protect against taxonomy_pathauto_bulkupdate being called outside of our form.
So, here is a patch which combines your work with a new check to see if there are objects to bulk update prior to showing the checkbox.
Comment #5
gregglesThis is actually against 6.x-2.x but we should fix it in 5.x-2 and 6.x-1.
Comment #6
arhak commentedsubscribing
Comment #7
greggles@arhak can you test the code? It needs reviews.
Thanks.
Comment #8
arhak commentedThe first patch obviously does the trick.
The second patch looks fine (just read it) but right now I have no time to play around all the details it covers
A comment regarding the fragment below: the addition of an initialization for
$vid_whereimprove readability, OTH the first assigment to it whenempty($vid_where)unnecessarily begins with" AND (vid = '%s' ";and from there everything gets more obscure.Consider the following fixes (I didn't run a
diffrather I wrote an imitation by hand):This is a little bit cleaner, don't you think?
Also, it could be done with less casuistic, but with a tweaked initialization:
What do you think about it?
Comment #9
gregglesIt may be cleaner but it changes the logic of the where clause. So...no.
The only patch worth testing is the one in #4.
Comment #10
gregglesUpdated patches for 6x and 5x.
Any testers/reviewers?
Comment #11
munrageek commentedHey every one.
the patch 286845_bulk_generate_no_objects_6x2.patch and 286845_bulk_generate_no_objects.patch don't work for me , this is the error in both:
used in pathauto 6.x-1.1 with Date 2008-Jun-26 and in Drupal 6.6.
The first one (pathauto_taxonomy.patch) works good.
Thanks for the patchs.
Comment #12
anoopjohn commentedThe patch 286845_bulk_generate_no_objects_6x2.patch ran fine. I tried the patch on the latest 6.x.2.x-dev version. However I cannot access any of the Fieldsets inside the Automated Alias Settings page after I ran the patch. Is that by design? ie no access to any settings when there are no categories? Shouldn't the settings be available without the bulk update options?
Comment #13
gregglesHmmm - the settings should be available, but not the "bulk generate" box. Perhaps this needs work.
Comment #14
coltrane6x2 patch from #10 applied cleanly to latest 6.x-2.x-dev. All fieldsets visible and functional and "bulk generate" box not visible when I had no vocabs or terms. Submitting form gave no errors.
Created vocab, submitted pathauto form again without errors. Created a term then went back to pathauto form and "bulk generate" option was there. Submitted with it checked and received no errors.
Not sure what wasn't working correctly for you @anoopjohn. What theme are you using?
Maybe get another set of eyes on this but I'm tempted to RTBC it for 6.x-2.x. Patch looks fine.
Comment #15
coltraneError confirmed with pathauto 5.x-2.x-dev. Patch for 5.x applies cleanly and bulk option not available without vocabs or terms.
Comment #16
ShutterFreak commentedSubscribing to this issue as it is still relevant for the latest official 6.x release: 6.x-1.1.
Comment #17
Witch commentedI always get timeouts when trying to bulk update categorys. i choosed 20 items per run :\
Comment #18
dave reidTagging all the bulk alias issues for #713238: RFC: Pathauto Bulk module.
Comment #19
durum commentedsubscribing
Comment #21
dave reidThis issue is a 'won't fix' because of the upcoming change in #201151: Use batch API to perform path alias bulk updates.