From 94ef27b7c1c4661310c0eb95ccca339db9093889 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 8 Apr 2013 21:22:43 -0700 Subject: [PATCH] Fix jQuery redirect params CRM-12298 --- templates/CRM/Financial/Form/Search.tpl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/templates/CRM/Financial/Form/Search.tpl b/templates/CRM/Financial/Form/Search.tpl index 8e60015efa..62f347641d 100644 --- a/templates/CRM/Financial/Form/Search.tpl +++ b/templates/CRM/Financial/Form/Search.tpl @@ -256,9 +256,16 @@ cj(function($) { } function exportRecords(records) { + var query = {'batch_id': records, 'export_format': $('select.export-format').val()}; var exportUrl = CRM.url('civicrm/financial/batch/export', 'reset=1'); - $().redirect(exportUrl, {'batch_id': records, 'export_format': $('select.export-format').val()}, 'GET'); - setTimeout(function() {batchSelector.fnDraw();}, 2000); + // jQuery redirect expects all query args as an object, so extract them from crm url + var urlParts = exportUrl.split('?'); + $.each(urlParts[1].split('&'), function(key, val) { + var q = val.split('='); + query[q[0]] = q[1]; + }); + $().redirect(urlParts[0], query, 'GET'); + setTimeout(function() {batchSelector.fnDraw();}, 4000); } function validateOp(records, op) { -- 2.25.1