SPM witt default filters breakes browsing all records (show all stops working)
Posted: 2019-01-31 09:08
Hi guys
Just found out, that I no longer are able to browse all records, when using AddFilter with SPM. The problem is that when clicking "Show all", the first page shows just fine, but when moving on to page 2 - the view is reset to the default view.
Packages_init from hooks/Packages.php:
When removing the three addFilter commands, browsing all records works as it should - but with the default filter in effect (the three addFilter commands active), browsing all records is broken.
Best regards, Søren
Just found out, that I no longer are able to browse all records, when using AddFilter with SPM. The problem is that when clicking "Show all", the first page shows just fine, but when moving on to page 2 - the view is reset to the default view.
Packages_init from hooks/Packages.php:
Code: Select all
function Packages_init(&$options, $memberInfo, &$args){
$options->FilterPage = 'hooks/Packages_filter.php';
$options->DefaultSortField = '`Packages`.`Priority` desc, `Packages`.`DateCreated` asc';
$options->DefaultSortDirection = '';
$SetFilter = true;
for ($i = 0; $i < 20; $i++) {
if($_POST['FilterField'][$i] || $_GET['FilterField'][$i]){
$SetFilter = false;
}
}
if($SetFilter == true){
addFilter(60, 'and', 15, 'equal-to', 'No');
addFilter(64, 'and', 14, 'not-equal-to', 'UAT');
addFilter(68, 'and', 14, 'not-equal-to', 'Completed');
}
return TRUE;
}
Best regards, Søren