Marking as critical because it may happen unnoticed that when you run a bulkupdate against nodes, the path for books are changed, removing the [book] or [bookpath], if you were using them. Which is something that fools visitors and worst, search engines.
[book] and [bookpath] placeholders are built using book_load(), which reads the {book} table based on the vid assigned to the node.
On top of the node_pathauto_bulkupdate() function there's the query used to walk all nodes. This query wasn't using the node vid. That lead to end up with no [book] and [bookpath] placeholders, silently breaking the paths that were using them.
Solution is to include 'vid' (appended at the end of the column list) to the main node_pathauto_bulkupdate() query:
$query = 'SELECT nid,type,title,uid,created,src,dst,vid FROM {node} '.
"LEFT JOIN {url_alias} ON CONCAT('node/', nid) = src";
I hope that helps. ;-)
Cheers
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | pathauto.module.fix_bookpath.patch | 531 bytes | markus_petrux |
Comments
Comment #1
markus_petrux commentedHere's the patch.
Comment #2
buddaLifesaver! Patch worked as expected. Is anybody going to commit this now that mikeryan isn't looking after pathauto?
Comment #3
Stefan Nagtegaal commentedFixed, thanks markus_petrux..
Comment #4
(not verified) commentedComment #5
Bodo Maass commentedSomehow this patch didn't make it into the 4.7.2 distribution.
I had the same problem with 4.7.2 and found this page. Adding ",vid" to line 203 of pathauto_node.inc fixed it again, but by default it is missing.
Comment #6
lennart commentedthis is still not working
Comment #7
lennart commentedthanks bodomaass, for the tip. It works now. Can we get this into the tarball?
Comment #8
greggleslennart - if you want to see this in the tarball you can test the patch, provide a review, or make sure that the status value was set to the correct value.
Since steef seemed to want to commit it (but seemingly hasn't) I'm setting this to RTC.
Comment #9
lennart commentedSorry I cannot patch from my laptop, and I am not going to see my desktop for a long time. I can confirm, though, that the change to line 203 works perfectly. I think this is equivalent to the patch.
Comment #10
lennart commentedThe patch works. I can confirm this.
Comment #11
Stefan Nagtegaal commentedIndeed, not sure how but this did not got into the CVS-version of pathauto..
Feel free to commit this Greggels..
Comment #12
gregglesI'm actually thinking now that this should be a duplicate of http://drupal.org/node/69789
If we use node_load then this is irrelevant, right?
Comment #13
gregglesI believe that http://drupal.org/node/69789 fixes the problem for book and bookpath in bulkupdate. Please reopen the issue if the updated version of pathauto doesn't solve the problem.