Browse Source

Issue #72: Updating API to include 2.1 improvements: 2b40df9

Stephen Ficklin 7 years ago
parent
commit
bf6520abd0
1 changed files with 4 additions and 1 deletions
  1. 4 1
      tripal_chado/api/tripal_chado.query.api.inc

+ 4 - 1
tripal_chado/api/tripal_chado.query.api.inc

@@ -1685,7 +1685,10 @@ function chado_pager_query($query, $args, $limit, $element, $count_query = '') {
   // get the page and offset for the pager
   $page_arg = isset($_GET['page']) ? $_GET['page'] : '0';
   $pages = explode(',', $page_arg);
-  $page = $pages[$element];
+  $page = 0;
+  if (count($pages) >= $element) {
+     $page = $pages[$element];
+  }
   $offset = $limit * $page;
   $q = $_GET['q'];