Commit 216ffc38 authored by Ivo Fokkema's avatar Ivo Fokkema

Fixed only_rows option for VLs.

- It was broken a few years ago when the VL settings moved to $_SESSION.
- Let $_GET override the only_rows setting for VLs.
- Make sure only_rows doesn't get saved in $_SESSION, to avoid problems the next time the VL is loaded not over ajax.
- This fixes the problem where deleting a single log entry didn't load the next page's first log entry.
parent 67a3e944
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2010-02-18
* Modified : 2019-09-23
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -262,8 +262,12 @@ if (LOVD_plus && isset($_INSTANCE_CONFIG['viewlists'][$_GET['viewlistid']]['cols
}
// Show the viewlist.
// Parameters are assumed to be in $_SESSION, only cols_to_skip can be overridden. This is for the external viewer.
$aOptions = array();
// Parameters could be assumed to be in $_SESSION. However, certain options we send through here.
// only_rows is checked and sent here because of the logs retrieving single rows from the next page.
// cols_to_skip can be overridden for the external viewer.
$aOptions = array(
'only_rows' => (!empty($_GET['only_rows'])),
);
if ($aColsToSkip) {
// Don't let the requested list of columns overwrite the original one. Only additional columns may be hidden.
$aOptions['cols_to_skip'] = array_unique(array_merge(
......
......@@ -2236,7 +2236,11 @@ class LOVD_Object {
$aOptions['multi_value_filter'] &= $aOptions['show_options'];
// Save viewlist options to session.
$_SESSION['viewlists'][$sViewListID]['options'] = $aOptions;
$_SESSION['viewlists'][$sViewListID]['options'] = array_merge(
$aOptions,
array(
'only_rows' => false, // only_rows should never be stored in SESSION.
));
if (!defined('LOG_EVENT')) {
define('LOG_EVENT', $this->sObject . '::viewList()');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment