MDL-33603 - data - added another sql query to allow links to records to work.
authorAdrian Greeve <adrian@moodle.com>
Thu, 14 Jun 2012 06:55:08 +0000 (14:55 +0800)
committerAdrian Greeve <adrian@moodle.com>
Mon, 18 Jun 2012 02:21:38 +0000 (10:21 +0800)
mod/data/view.php

index 47dcbee..3e9146e 100644 (file)
@@ -613,8 +613,12 @@ if ($showactivity) {
         if ($record) {     // We need to just show one, so where is it in context?
             $nowperpage = 1;
             $mode = 'single';
-            $page = (int)array_search($record->id, $recordids);
-
+            $page = 0;
+            // TODO MDL-33797 - Reduce this or consider redesigning the paging system.
+            if ($allrecordids = $DB->get_fieldset_sql($sqlselect, $allparams)) {
+                $page = (int)array_search($record->id, $allrecordids);
+                unset($allrecordids);
+            }
         } else if ($mode == 'single') {  // We rely on ambient $page settings
             $nowperpage = 1;