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.

CommentFileSizeAuthor
#1 flippy-alias-2106305-1.patch846 byteszambrey

Comments

zambrey’s picture

Status: Active » Needs review
StatusFileSize
new846 bytes

It 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.

rli’s picture

Status: Needs review » Fixed

Thanks, just realized that.

Committed to dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.