The docs say that you can call faq_page() directly to display the FAQs inside of another page. This works, but only if you don't pass in a $tid.
This section is the problem:
if (!empty($tid) && $current_term = taxonomy_term_load($tid)) {
if (!drupal_lookup_path('alias', arg(0) . '/' . $tid) && module_exists('pathauto')) {
$alias = pathauto_create_alias('faq', 'insert', arg(0) . '/' . arg(1), array('term' => $current_term));
if ($alias) {
drupal_goto($alias['alias']);
}
}
if (drupal_match_path($_GET['q'], 'faq-page/*')) {
faq_set_breadcrumb($current_term);
}
}
I'm calling faq_page(5) on a node with an alias, so the current url is /sample-node-alias. The arg(0) is 'node' and arg(1) is 9 (the nid), so it tries to create an alias to "node/$tid" which is incorrect. Then on the following few lines it uses a different but still incorrect alias pattern, resulting in an infinite loop.
My temporary solution was to disable the section entirely. I don't use the term pages anywhere so the breadcrumb / alias creation is irrelevant.
As for a permanent solution, the aliases created need to be more specific (such as only applying to standard FAQ pages) and consistent with the redirect logic. The whole section could also be skipped if the breadcrumb checkbox is disabled.
Comments
Comment #1
bbcThanks kwinters for pointing out the problematic code. I've got 4 nodes where I'm appending FAQs for a given taxonomy term to the end of the page in a preprocess function. In my case, the problem was somewhat random and only presented itself for some of the taxonomy terms. The strange thing is that I ran into the issue when first setting up FAQ and resolved it by creating a new term. However, it came up again a couple weeks later on a page/term that had been working just fine for a while.
Also, a request to the page (ex. node/167 or its alias) resulted in the creation of multiple entries in the url_alias table. Typically it would generate 40+ entries per attempt to load the page before realizing it was in an infinite loop and timing out.
I'm not using the breadcrumb trail either, so commenting out this section seems to have done the trick.
Comment #2
mediaformat commentedConfirming this bug is still active, and the fix above works.