We are using this wonderful Conference Module 6.x-1.2-beta2.

Under Manage conference -> Assign reviews tab it shows only 25 items. We have over 200 items.

How do I get to list all the items under the 'Assign reviews' tabs? Clicking the 'Date' sort by kind of helps but not very helpful as we would like to view them all. Is there a place where i can modify this?

Thank you.

~UK

Comments

uk_1970’s picture

Title: Assign reviews tab it shows only 25 items » Pager for 'Assign reviews' tab not working. Help.
Component: User interface » Code
Category: feature » bug
Priority: Normal » Critical

What is mean is this. The pager for the 'Assign reviews' Tab doesn't seem to be working.

I opened the conference.module file and found this which explains why its showing 25 items but not sure why the pager is not working:

/**
 * List all papers with the assigned reviewers.
 */
function conference_manage_assignment() { // was: function conference_management_list ()

  if ( ! $ctype_paper = variable_get('conference_ctype_paper', '')
    or ! $ctype_review= variable_get('conference_ctype_review', ''))
    return conference_setup_required();

  // table header
  $header = array(
      array(data => t('Title'),       field => 'n.title'      ),
      array(data => t('User'),        field => 'n.uid'        ),
      array(data => t('Date'),        field => 'n.created',   sort => 'desc'),
      array(data => t('Reviewer'),    field => 'c.rnid'       ),
// del in 1.3
      array (data => t('Revisions?')    ),
      array(data => t('Reviewed?')    ),
      array(data => t('Assignment')   ),
  );
  $rows= array();

  // get a paged list of all papers
  // (TODO: we could avoid loading ALL data of the node here.)
  $sql = "SELECT * FROM {node} n LEFT JOIN {conference} c ON n.nid = c.pnid WHERE n.type='%s' AND (c.pvid =  n.vid OR c.pvid is NULL OR c.pvid = (SELECT max(c.pvid) FROM {conference} c WHERE c.pnid = n.nid))";
  $sql .= tablesort_sql($header);
	 
  $result = pager_query($sql, 25, 0, NULL, $ctype_paper);  
  while ( $item = db_fetch_array( $result )) {
    // get user information
    $p_user = user_load( array( 'uid' => $item['uid']));
    if ($item['pvid'] == $item['vid']) {
      $r_user = ($item['ruid'] ? user_load(array( 'uid' => $item['ruid'])) : NULL);
    }
    else {
      $r_user = NULL;
    }

    // choose some operations to display
    //added vid to keep track of revisions
    $op = array();
    if ($r_user) { //Fixed the fact that edit and create was being shown
      $op[] = l( t( 'edit' ), 'conference/manage/assignment/edit',
              array ( 'attributes' => array( 'title' => t("edit this assignment") ) , 
                      'query' => "pnid=$item[nid]&pvid=$item[vid]&ruid=$r_user->uid"
                    ));
    } else {
    $op[]= l( t( 'create' ), 'conference/manage/assignment/edit',
              array ( 'attributes' => array( 'title' => t("create a new assignment") ), 
                      'query' => "pnid=$item[nid]&pvid=$item[vid]" 
                     )); // added by MFH
    }

    //check for existance of reviews and display the content
    $total_revisions = db_result( db_query("SELECT count(*) FROM {node_revisions} WHERE nid = %d", $item['nid']));
 
    // build row
    $rows[] = array( 
                l( $item['title'], 'node/'. $item['nid'] ),
                l( $p_user->name, 'user/'. $p_user->uid),
                format_date( $item['created']),
                $r_user ? l( $r_user->name, 'user/'. $r_user->uid) : t('not assigned'),
                $total_revisions == 1 ? t('No') : l('Yes', 'conference/manage/revisions/'.$item['nid']),
                $item['rnid'] && $r_user ?  l( t('yes: see review' ), "node/$item[rnid]" ) : t('no'),
                implode( ', ', $op),
            );
  };
 $content = theme('table', $header, $rows) . theme('pager', NULL, 25, 5);   
  print theme( 'page', $content );
};

This code only prints or list 25 items out of 500 items without pager. I do not wish to display all 500 items in one page...but rather I would like to have a pager much like the 'Decision' Tab. BTW...the code for the 'Assign reviews' Tab looks identical to the 'Decision' Tab but for some reason the 'Assign reviews' Tab not working.

Can anyone help?

Thanks.

jenifertucker’s picture

Have you checked the view settings for this to see if the pager is set to be on?

I haven't had much luck with the postings of bugs I've found for the conference module other than an email from zyxware after waiting many weeks for a response to say they are maintaining the module but are not actively developing or working on the module but offering paid customisations of this module :-(

uk_1970’s picture

hi JeniferTucker,

thanks for your post. Where would I find the 'view settings'? I looked everywhere, including the conference settings page but can't find it. Can you tell me where it is?

I am thinking there must be an easy way to turn the pager on. If it works for on 'tab' it should also work for the other 'tab'. right?

That's too bad that you can't get any good responses to get the bugs fixed unless you paid them. :(
So that I am also aware of, what other bugs have you found?

Thanks

~uk_1970.

BasMichielsen’s picture

Hello,

I also found this problem and posted this in May this year:

There is an error in conference.module which makes that the pager does not appear on two of the conference manager pages.

In function conference_manage_assignment and in function conference_revisions
line 591 resp. line 2512 should be
$result = pager_query($sql, 25, 5, NULL, $ctype_paper);

Hopefully, that solves this problem for you,

Bas Michielsen

jenifertucker’s picture

Hello Bas

You wouldn't have come across this bug in this module as well by any chance? I'm not really getting anywhere and would welcome any suggestions.

Broken/missing handler or Array
http://drupal.org/node/850256

Many thanks
Jenifer

uk_1970’s picture

I fixed it. Pls disregard post below. On both functions I just changed it from 0 to 5.
$result = pager_query($sql, 25, 0, NULL, $ctype_paper); to
$result = pager_query($sql, 25, 5, NULL, $ctype_paper);

That works.

Thanks a lot.

hi. Thanks for the post.

The numbers 591 and 2512 on conference_manage_assignment() and in function conference_revisions() does not match with mine. Not sure why.

As shown below.... it looks like the code you've mentioned does exist on both functions. See below. What am I missing?

code for conference_revisions() function

function conference_revisions ($nid = NULL) {

  if ( ! $ctype_paper = variable_get('conference_ctype_paper', '')

    or ! $ctype_review= variable_get('conference_ctype_review', ''))

    return conference_setup_required();



  $node_select = "";

  

  if ($nid != NULL) {

    $node_select = " AND n.nid = '$nid'";

  }

  // table header

  $header = array(

      array(data => t('Title'),       field => 'n.title'      ),

      array(data => t('User'),        field => 'nr.uid'        ),

      array(data => t('Date'),        field => 'nr.timestamp',   sort => 'desc'),

      array(data => t('Reviewer'),    field => 'c.rnid'       ),

// del in 1.3

      array (data => t('Reason')    ),

      array(data => t('Reviewed?')    ),

  );

  $rows= array();



  // get a paged list of all papers

  // (TODO: we could avoid loading ALL data of the node here.)

  $sql  = "SELECT n.title, nr.uid, c.ruid, nr.log, n.nid, nr.timestamp, nr.vid, c.rnid";  

  $sql .= " FROM {node} n , ({node_revisions} nr LEFT JOIN {conference} c on nr.vid = c.pvid AND nr.nid = c.pnid)"; 

  $sql .= " WHERE n.type='%s' AND nr.nid = n.nid ".$node_select;

  $sql .= tablesort_sql($header);

  $result = pager_query($sql, 25, 0, NULL, $ctype_paper);  // HERE IT IS!!!!

  while ( $item = db_fetch_array( $result )) {

    // get user information

    $p_user = user_load( array( 'uid' => $item['uid']));

    $r_user = ($item['ruid'] ? user_load(array( 'uid' => $item['ruid'])) : NULL);



    //check for existance of reviews and display the content

    $total_revisions = db_result( db_query("SELECT count(*) FROM {node_revisions} WHERE nid = %d", $item['nid']));



    // build row

    $rows[] = array( 

                l( $item['title'], 'node/'. $item['nid'].'/revisions/'.$item['vid'].'/view' ),

                l( $p_user->name, 'user/'. $p_user->uid),

                format_date( $item['timestamp']),

                $r_user ? l( $r_user->name, 'user/'. $r_user->uid) : t('not assigned'),

                $item['log'] ? $item['log'] : t('Original submission'),

                $item['rnid'] ?  l( t('yes: see review' ), "node/$item[rnid]" ) : t('no'),

            );

  };

  $content = theme('table', $header, $rows) . theme('pager', NULL, 25, 5);

  print theme( 'page', $content );  

}

Code for function conference_manage_assignment() function.


function conference_manage_assignment() { // was: function conference_management_list ()



  if ( ! $ctype_paper = variable_get('conference_ctype_paper', '')

    or ! $ctype_review= variable_get('conference_ctype_review', ''))

    return conference_setup_required();



  // table header

  $header = array(

      array(data => t('Title'),       field => 'n.title'      ),

      array(data => t('User'),        field => 'n.uid'        ),

      array(data => t('Date'),        field => 'n.created',   sort => 'desc'),

      array(data => t('Reviewer'),    field => 'c.rnid'       ),

// del in 1.3

      array (data => t('Revisions?')    ),

      array(data => t('Reviewed?')    ),

      array(data => t('Assignment')   ),

  );

  $rows= array();



  // get a paged list of all papers

  // (TODO: we could avoid loading ALL data of the node here.)

  $sql = "SELECT * FROM {node} n LEFT JOIN {conference} c ON n.nid = c.pnid WHERE n.type='%s' AND (c.pvid =  n.vid OR c.pvid is NULL OR c.pvid = (SELECT max(c.pvid) FROM {conference} c WHERE c.pnid = n.nid))";

  $sql .= tablesort_sql($header);

	 

  $result = pager_query($sql, 25, 0, NULL, $ctype_paper);  // HERE IS THE OTHER ONE!!!

  while ( $item = db_fetch_array( $result )) {

    // get user information

    $p_user = user_load( array( 'uid' => $item['uid']));

    if ($item['pvid'] == $item['vid']) {

      $r_user = ($item['ruid'] ? user_load(array( 'uid' => $item['ruid'])) : NULL);

    }

    else {

      $r_user = NULL;

    }



    // choose some operations to display

    //added vid to keep track of revisions

    $op = array();

    if ($r_user) { //Fixed the fact that edit and create was being shown

      $op[] = l( t( 'edit' ), 'conference/manage/assignment/edit',

              array ( 'attributes' => array( 'title' => t("edit this assignment") ) , 

                      'query' => "pnid=$item[nid]&pvid=$item[vid]&ruid=$r_user->uid"

                    ));

    } else {

    $op[]= l( t( 'create' ), 'conference/manage/assignment/edit',

              array ( 'attributes' => array( 'title' => t("create a new assignment") ), 

                      'query' => "pnid=$item[nid]&pvid=$item[vid]" 

                     )); // added by MFH

    }



    //check for existance of reviews and display the content

    $total_revisions = db_result( db_query("SELECT count(*) FROM {node_revisions} WHERE nid = %d", $item['nid']));

 

    // build row

    $rows[] = array( 

                l( $item['title'], 'node/'. $item['nid'] ),

                l( $p_user->name, 'user/'. $p_user->uid),

                format_date( $item['created']),

                $r_user ? l( $r_user->name, 'user/'. $r_user->uid) : t('not assigned'),

                $total_revisions == 1 ? t('No') : l('Yes', 'conference/manage/revisions/'.$item['nid']),

                $item['rnid'] && $r_user ?  l( t('yes: see review' ), "node/$item[rnid]" ) : t('no'),

                implode( ', ', $op),

            );

  };

 // $content = theme('table', $header, $rows) . theme('pager', NULL, 25, 5); // Original...

	  $content .= theme('table', $header, $rows);

  $content .= theme('pager', NULL, 25, 5);

  print theme( 'page', $content );

};