SPM witt default filters breakes browsing all records (show all stops working)

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
SSchimkat
Posts: 29
Joined: 2018-01-04 18:49

SPM witt default filters breakes browsing all records (show all stops working)

Post by SSchimkat » 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:

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;
        }
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

Post Reply