When updating to HEAD version, I get the following error:

An error occurred. (...)/update.php?id=10&op=do <br /> <b>Fatal error</b>: Cannot use object of type stdClass as array in <b>(...)/sites/all/modules/send/send.install</b> on line <b>530</b><br />

  $templates = array();
  while ($row = db_fetch_object($res)) {
    $format = send_value('template_format', $row->module, $row->nodetype, $row->nid);

    // Don't create a bunch of duplicate entries.
    $hash = md5($row->body . $format);
    if (!isset($templates[$hash])) {
      $template = (object) array(
        'name' => '',
        'status' => 1,
        'body' => $row->value,
        'format' => $format,
        'rows' => array(),
      );
      $templates[$hash] = $template; // note 1
    }

    $templates[$hash]['rows'][] = $row; // note 2

At note 1 it's assumed $templates[$hash] is an array of objects, but at note 2 $template['$hash'] is an array of arrays. Note 2, and once more below it, should instead be:

$templates[$hash]->rows[] = $row;

Patch attached.

Comments

Ryan Palmer’s picture

This patch is contributed by TP1 Internet 360, a Montreal-based Drupal web studio.

jerdavis’s picture

Status: Needs review » Closed (duplicate)

Committed this fix today after reviewing http://drupal.org/node/646580, thanks!