The error is in the first case clause of the switch statement that appears in the function theme_casetracker_comment_changes($variables), which is in the casetracker.module file.

The code reads:

$new_title = db_select('node', 'n')
->fields('n', array('node'))
->condition('n.nid', $new->pid)
->execute()
->fetchField();

There is no field named 'node', and this results in an exception being thrown (and uncaught).

The above statement needs to be replaced with:

$new_title = db_select('node', 'n')
->fields('n', array('title'))
->condition('n.nid', $new->pid)
->execute()
->fetchField();

Unfortunately I am not equipped to provide you with a patch.

Bob

CommentFileSizeAuthor
#2 casetracker-fix_col_error-1981194-2.patch629 bytestanius
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skyredwang’s picture

Status: Active » Needs review
tanius’s picture

The original poster's instructions fixed the issue for me. Patch against latest dev version 7.x-1.0-alpha1+1-dev included. (It's my first patch for Drupal though ...)

tanius’s picture

For the record, the exact error message that I got with this issue was:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'n.node' in 'field list': SELECT n.node AS node FROM {node} n WHERE (n.nid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 460 ) in theme_casetracker_comment_changes() (line 928 of [...]/httpdocs/sites/all/modules/casetracker/casetracker.module).

It happened only with some case nodes though, not with all.

Anonymous’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

The patch works excellently. Marking as RTBC.

  • metzlerd committed 524e025 on 7.x-1.x authored by tanius
    Issue #1981194 by tanius: db_select error in function...
metzlerd’s picture

Status: Reviewed & tested by the community » Fixed

Although the patch was generated from the wrong directory, I manually applied and committed this.

Thanks.

Status: Fixed » Closed (fixed)

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