From e05865b1cd1cfe87b990d3a575408d86d63eb5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 7 May 2021 14:07:01 +0200 Subject: [PATCH] backoffice: fix URL used for autocomplete criterias on statistics pages (#53848) --- wcs/qommon/static/js/wcs.listing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcs/qommon/static/js/wcs.listing.js b/wcs/qommon/static/js/wcs.listing.js index 7e5fe96a6..8e641db66 100644 --- a/wcs/qommon/static/js/wcs.listing.js +++ b/wcs/qommon/static/js/wcs.listing.js @@ -180,7 +180,7 @@ $(document).on('backoffice-filter-change', function(event, listing_settings) { $('[data-refresh-options]').each(function(idx, elem) { var $select = $(elem); var current_value = $select.val(); - var filter_path = pathname + 'filter-options?filter_field_id=' + $(elem).data('refresh-options') + '&' + listing_settings.qs; + var filter_path = pathname.replace(/stats$/, '') + 'filter-options?filter_field_id=' + $(elem).data('refresh-options') + '&' + listing_settings.qs; $.ajax({ url: filter_path, success: function(data) { @@ -300,7 +300,7 @@ $(function() { minimumInputLength: 1, ajax: { url: function() { - var pathname = window.location.pathname.replace(/^\/+/, '/'); + var pathname = window.location.pathname.replace(/^\/+/, '/').replace(/stats$/, ''); var filter_settings = $('form#listing-settings').serialize(); return pathname + 'filter-options?filter_field_id=' + filter_field_id + '&' + filter_settings; },