There is unecessary call to drupal_get_path_alias() in template_preprocess_flippy() resulting in duplicated query for each node.
$links['prev'] = array(
'title' => t(variable_get('flippy_prev_label_' . $vars['node']->type, NULL)),
'href' => empty($nav['prev']) ? '' : drupal_get_path_alias('node/' . $nav['prev']['nid'], 'und'),
);
$links['next'] = array(
'title' => t(variable_get('flippy_next_label_' . $vars['node']->type, NULL)),
'href' => empty($nav['next']) ? '' : drupal_get_path_alias('node/' . $nav['next']['nid'], 'und'),
);
This is then used in flippy.tpl.php
<?php print l($link['title'], $link['href'], array('html' => TRUE, 'attributes' => array('title' => $link['title']))); ?>
By default l() function (in fact url()) assumes that second parameter is internal path (not alias). So it performs additional query looking for alias to already aliased path.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | flippy-alias-2106305-1.patch | 846 bytes | zambrey |
Comments
Comment #1
zambrey commentedIt can be fixed in two ways. Either set 'alias' => TRUE in l() options or drop drupal_get_path_alias() from template_preprocess_flippy().
I prefer second option.
Comment #2
rliThanks, just realized that.
Committed to dev.