Hi,
'Pathauto' comes with a bulk update feature that is supposed to be able to bulk update (create) taxonomy term aliases. However, this does not work for me on a site with approximately 35,000 taxonomy terms.
The setting is available at ./admin/build/path/update_bulk
, I can start the procedure, and the batch API claims to initialize. Thas goes on for at least an hour, without any errors or timeouts. Nothing related to path aliases is logged in Drupal's watchdog, Apache's error log remains clean of new error messages, as well. As far as I can tell, no aliases are created at all. It just "initializes" (screenshot attched), but seems not to do anything.
Possibly related: #1240760: Initialization process uses query that causes full table scan
Any workarounds or other suggestions how to fix missing aliases?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
path-update-bulk-initializing.jpg | 35.03 KB | asb |
Comments
Comment #1
asb CreditAttribution: asb commentedShort addition: It might be doing something, even if I cancelled the process some about two hours ago.
For some time I'm experiencing a pretty high server load (12 on a quad core with a normal load average around 2.5) and lots of activity in MySQL. According to 'mytop', queries like this are executed:
Comment #2
olteanu5000 CreditAttribution: olteanu5000 commentedI had the same issue with version 7.x-1.2.
In file pathauo.pathauto.inc there is taxonomy_pathauto_bulk_update_batch_process. There you have the following query:
$query = db_select('taxonomy_term_data', 'td');
$query->leftJoin('url_alias', 'ua', "CONCAT('taxonomy/term/', td.tid) = ua.source");
$query->addField('td', 'tid');
$query->isNull('ua.source');
$query->condition('td.tid', $context['sandbox']['current'], '>');
// Exclude the forums terms.
if ($forum_vid = variable_get('forum_nav_vocabulary', '')) {
$query->condition('td.vid', $forum_vid, '<>');
}
$query->orderBy('td.tid');
$query->addTag('pathauto_bulk_update');
$query->addMetaData('entity', 'taxonomy_term');
I dont think the leftJoin condition and the isNull condition are compatible. I commented the $query->isNull('ua.source'); line and the update worked ok.
For version 6.x-2.0 you have this line:
$sql = "SELECT t.tid FROM {term_data} t LEFT JOIN {url_alias} ua ON $concat = ua.src WHERE ua.src IS NULL AND t.tid > %d AND t.vid <> %d ORDER BY t.tid";
Replace it with this and it should work:
$sql = "SELECT t.tid FROM {term_data} t LEFT JOIN {url_alias} ua ON $concat = ua.src WHERE t.tid > %d AND t.vid <> %d ORDER BY t.tid";
Comment #3
asb CreditAttribution: asb commentedHi olteanu5000,
thanks for the code modification! I tried this, but the behaviour described above doesn't change: The bulk update keeps initializing and Batch API does not indicate any progress; in the background, the server load increases, and slow queries like this are executed: