Permalink
Browse files

MDL-33603 - data - added another sql query to allow links to records …

…to work.
  • Loading branch information...
1 parent 85c4758 commit db79db63ede07e3c5e1c9424e988a944612ac0f8 @abgreeve abgreeve committed Jun 14, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 mod/data/view.php
View
@@ -613,8 +613,12 @@
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;

0 comments on commit db79db6

Please sign in to comment.