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

EmanueleQuinto’s picture

StatusFileSize
new1.42 KB

Wrong patch this is the correct one...

seanr’s picture

I'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.

seanr’s picture

Status: Active » Postponed (maintainer needs more info)

please try the latest update in HEAD. This should now be fixed.

john.oltman’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
nevets’s picture

Surprised the patch works since db_fetch_object() was also removed in D7

john.oltman’s picture

The code now uses db_query_range, which is Drupal 7 compatible. So the issue is fixed, even if the patch itself is obsolete.