From e39a5a7717afc6bad2b99f7f28e3a613c730edb0 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 12 Jul 2013 10:55:56 +0200 Subject: [PATCH] Partpicker: filter.type nur mitschicken, wenn wirklich ein Typ angegeben war MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ansonsten wird "&filter.type[]=" geschickt, was in Perl letztlich als "$::form->{type} = ['']" ankommt -- und damit ungültige Filter erstellt. --- js/autocomplete_part.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/autocomplete_part.js b/js/autocomplete_part.js index 901da5e79..b8b6b5ccf 100644 --- a/js/autocomplete_part.js +++ b/js/autocomplete_part.js @@ -28,13 +28,18 @@ namespace('kivi', function(k){ }; function ajax_data(term) { - return { + var data = { 'filter.all:substr::ilike': term, - 'filter.type': $type.val().split(','), 'filter.obsolete': 0, column: $column.val()===undefined ? '' : $column.val(), current: $real.val(), - } + }; + + var type = $type.val(); + if (type !== '') + data['filter.type'] = type.split(','); + + return data; } function set_item (item) { -- 2.20.1