I need to be able to sort by "Reviewed" on the "My reviews" page. Right now it only allows sorting on Title and Submitted columns.

Thank you!

Ceci

CommentFileSizeAuthor
sortByReviewed.jpg33.2 KBceci123
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ceci123’s picture

After looking into the conference.module file I found this code and added this line to it:
array('data' => t('Reviewed' ), 'field' => 'Reviewed' , 'sort' => 'asc'), but is causing this error:

user warning: Unknown column 'Reviewed' in 'order clause' query: SELECT * FROM conference c LEFT JOIN node n ON c.pnid = n.nid WHERE c.ruid = 21 ORDER BY Reviewed ASC LIMIT 0, 10 in /var/www/html/conference_search/sites/all/modules/conference/conference.module on line 1403.

Obviously its looking for the "Reviewed" column but don't know where to add it.

Here is the CODE:

function conference_reviews() {
  global $user; $uid = $user->uid;
  if ( ! $ctype_review = variable_get('conference_ctype_review', 0)) {
    // don't tell the reviewer about the missing setup problem...
    drupal_set_message( "There are no reviews assigned to you." );
    return;
  }
  $content = t('The following table contains all papers assigned to you:');

  // table header
  $header = array(
    array('data' => t('Title' ), 'field' => 'title' ),
    array('data' => t('Submitted' ), 'field' => 'created' , 'sort' => 'asc'),
    array('data' => t('Download' )),
    array('data' => t('Reviewed' ), 'field' => 'Reviewed' , 'sort' => 'asc'),
    array('data' => t('Operations' ))
  );
  $rows= array();

  // get papers
  $sql = "SELECT * FROM {conference} c LEFT JOIN {node} n ON c.pnid = n.nid WHERE c.ruid = %d";
  $sql .= tablesort_sql($header);
  if ( $result = pager_query($sql, 10, 9, NULL, $uid))
  while ( $item = db_fetch_object( $result )) {
    // choose some operations
    if (! $item->rnid)     
      $op = l( t("create review"), 'node/add/'. str_replace('_', '-', $ctype_review), 
              array ( 'attributes' => array('title' => 'Create A Review'), 
                      'query' => 'pnid='. $item->nid.'&pvid='.$item->vid)
              );
    else 
      $op = l( t("view/edit review"), 'node/'. $item->rnid);

Thank you for your help.

Ceci