On line 624 of the forward.module (v 1.54 2007/10/14 HEAD version) there is a call todb_num_rows metthod that was removed from the database abstraction layer in 6.x core, as it was a database dependent method. Developers need to use other handling to replace the needs of this method. As from http://drupal.org/node/114774#db-num-rows
if (db_num_rows($result)) {
while ($log = db_fetch_object($result)) {
$_path = drupal_get_path_alias('node/'. $log->nid);
$rows[] = array(
array('data' => format_date($log->timestamp, 'small'), 'nowrap' => 'nowrap'),
$log->type,
l($_path, $_path),
l(_forward_column_width($log->title), $_path)
);
}
if ($pager = theme('pager', null, 30, 0)) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
$output = '<p><strong>'. variable_get('forward_total', 0) .'</strong> '. t('emails sent to') .' <strong>'. variable_get('forward_recipients', 0) .'</strong> '. t('recipients') .'</p>';
$output .= theme('table', $header, $rows);
}
else {
$output = '<p>'. t('No one has used Forward yet.') .'</p>';
}
Patched using $num_rows and a while...
$num_rows = FALSE;
while ($log = db_fetch_object($result)) {
$num_rows = TRUE;
$_path = drupal_get_path_alias('node/'. $log->nid);
$rows[] = array(
array('data' => format_date($log->timestamp, 'small'), 'nowrap' => 'nowrap'),
$log->type,
l($_path, $_path),
l(_forward_column_width($log->title), $_path)
);
}
if($num_rows) {
if ($pager = theme('pager', null, 30, 0)) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
$output = '<p><strong>'. variable_get('forward_total', 0) .'</strong> '. t('emails sent to') .' <strong>'. variable_get('forward_recipients', 0) .'</strong> '. t('recipients') .'</p>';
$output .= theme('table', $header, $rows);
}
else {
$output = '<p>'. t('No one has used Forward yet.') .'</p>';
}
Comments
Comment #1
EmanueleQuinto commentedWrong patch this is the correct one...
Comment #2
seanrI'll commit this patch, but the HEAD version of Forward is currently quite a bit behind the 5.x version in terms of features, as I never had time to port the recent changes. I will try to do that within the next couple of weeks.
Comment #3
seanrplease try the latest update in HEAD. This should now be fixed.
Comment #4
john.oltman commentedComment #5
nevets commentedSurprised the patch works since db_fetch_object() was also removed in D7
Comment #6
john.oltman commentedThe code now uses db_query_range, which is Drupal 7 compatible. So the issue is fixed, even if the patch itself is obsolete.