While working on #210256, I noticed that status codes for "fixed" and "closed" are hard-coded in the auto close subroutine.

    $result = db_query('SELECT p.nid, p.pid, p.category, p.component, p.priority, p.rid, p.assigned, p.sid, n.title FROM {project_issues} p INNER JOIN {node} n ON n.nid = p.nid WHERE n.status = 1 AND p.sid = 2 AND n.changed < %d', time() - 14 * 24 * 60 * 60);

and

  // TODO: It's evil to hard-code the status here.
  $comment['sid'] = 7;

While it is unlikely that anyone would rearrange the values for their status levels, but it is possible. This would lead to some wildly unexpected results when the auto closer runs.

Simply changing the auto closer to search for strings doesn't seem like a wise approach, either. Perhaps a wiser solution would be to allow one status level to be set as an auto close target, with 7 (Closed) as the default. It may also make sense to allow a flag on all other status levels to make them "auto closable." That would allow sites to configure other custom levels that will automatically switch to closed.

This is obviously a low priority issue, but it should probably be reviewed at some point.

Comments

dww’s picture

Status: Active » Closed (duplicate)