I'm using the following code in my custom formatter:
$result = '';
foreach ($variables['#items'] as $delta => $item)
{
if ($item['access']) {
$nid = $item['nid'];
$url = url(drupal_get_path_alias('node/' . $nid), array('absolute' => TRUE));
$entity_type = 'node';
$bundle = 'page';
$nids = array($nid);
$field_values = db_select('field_revision_field_optional', 'f')
->fields('f', array('entity_id', 'field_optional_value'))
->condition('entity_type', $entity_type, '=')
->condition('bundle', $bundle, '=')
->condition('entity_id', $nids, 'IN')
->condition('deleted', 0, '=')
->execute()
->fetchAllKeyed();
$text = $field_values[$nid];
$result .= '<a href="' . $url . '">' . $text . '</a>, ';
}
}
return substr($result, 0, -2);
With having devel's logging mysql-queries enabled I get the following error (its number of duplicates depends on number of values printed by formatter):Notice: Undefined index: args в функции DatabaseLog->findCaller() (строка 156 в файле /home/u9501/domains/progprofi.ru/includes/database/log.inc).
I don't know whose problem it is: mine, yours or devel module's?