From 24ad12fa2270434761d62b0b3e575fc02d8e73c2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 21 Dec 2024 14:34:35 -0500 Subject: [PATCH] Don't include empty fields in filter query string, just to shorten it a bit --- web/includes/Filter.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web/includes/Filter.php b/web/includes/Filter.php index f2a8f5b9f..97088498b 100644 --- a/web/includes/Filter.php +++ b/web/includes/Filter.php @@ -90,9 +90,12 @@ class Filter extends ZM_Object { $this->_querystring .= $term->querystring($objectname, $separator); } # end foreach term $this->_querystring .= $separator.urlencode($objectname.'[Query][sort_asc]').'='.$this->sort_asc(); - $this->_querystring .= $separator.urlencode($objectname.'[Query][sort_field]').'='.$this->sort_field(); - $this->_querystring .= $separator.urlencode($objectname.'[Query][skip_locked]').'='.$this->skip_locked(); - $this->_querystring .= $separator.urlencode($objectname.'[Query][limit]').'='.$this->limit(); + if ($this->sort_field()) + $this->_querystring .= $separator.urlencode($objectname.'[Query][sort_field]').'='.$this->sort_field(); + if ($this->skip_locked()) + $this->_querystring .= $separator.urlencode($objectname.'[Query][skip_locked]').'='.$this->skip_locked(); + if ($this->limit()) + $this->_querystring .= $separator.urlencode($objectname.'[Query][limit]').'='.$this->limit(); if ( $this->Id() ) { $this->_querystring .= $separator.$objectname.urlencode('[Id]').'='.$this->Id(); }