Hello,

I am using Cache Expiration 7.x-1.0-alpha2 on a pressflow/drupal 7 website. Every time I create a new node, I get a white page and the following error in my apache logs:
PHP Fatal error: Call to undefined function db_fetch_array() in /.../sites/all/modules/expire/expire.domain.inc on line 15, referer: http://.../node/170968/edit

Has someone an idea what the problem is?

Other useful information:
Server: varnish 2.1 => apache 2.2.16 (Debian)
Drupal: pressflow 7
Used Modules:
varnish 7.x-1.0-beta1+2-dev (2012-Mär-20)
expire 7.x-1.0-alpha2
purge 7.x-1.5-rc1
domain module

Comments

niccolox’s picture

am getting the same error in a slightly different environment, Aegir BOA

but its a bug alright, disabled Purge and Cache for now

halcyonCorsair’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.11 KB

Here is a patch to update the database calls.

I don't have the domain module setup, so could someone test this for me?

MJH’s picture

The patch from #2 seems to work.
No more errors and the varnish cache is cleared correctly.

halcyonCorsair’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha3
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

apemantus’s picture

Status: Closed (fixed) » Needs work

So the current code is:

function expire_get_domains(&$node) {
  $domains = array();
  if ($node->nid) {
    $result = db_query("SELECT gid FROM {domain_access} WHERE nid = :nid", array(':nid' => $node->nid));
    foreach ($result as $row) {
      $domains[$gid] = $row->gid;
    }
  }
  elseif ($node->mail && $node->name) {
    $result = db_query("SELECT domain_id FROM {domain_editor} WHERE uid = :uid", array(':uid' => $node->uid));
    foreach ($result as $row) {
      $domains[$gid] = $row->domain_id;
    }
  }
  return $domains;
}

I've got some issues with expire, domain access and workbench moderation. I haven't tracked down the main issue, but one thing is here I'm getting error messages as $gid is not defined. I suspect the code won't work as it stands, but like I say there's some other issues in play. I think

    foreach ($result as $row) {
      $domains[$gid] = $row->gid;
    }

should be

    foreach ($result as $row) {
      $gid = $row->gid;
      $domains[$gid] = $gid;
    }
apemantus’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB

Patch attached

spleshka’s picture

Status: Needs review » Fixed

In new branch this issue is fixed.

spleshka’s picture

Version: 7.x-1.0-alpha3 » 7.x-2.x-dev

Forgot to change version number.

Status: Fixed » Closed (fixed)

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