Skip to content
Snippets Groups Projects
Commit 6d13d1c4 authored by bgm's avatar bgm Committed by bgm
Browse files

#932 Fix dedupe contacts flip selection

parent 5c050e1a
No related branches found
No related tags found
No related merge requests found
......@@ -938,7 +938,10 @@ LIMIT {$offset}, {$rowCount}
public static function flipDupePairs($prevNextId = NULL) {
if (!$prevNextId) {
// @todo figure out if this is always POST & specify that rather than inexact GET
$prevNextId = CRM_Utils_Request::retrieve('pnid', 'Integer');
// We cannot use CRM_Utils_Request::retrieve() because it might be an array.
// It later gets validated in escapeAll below.
$prevNextId = $_REQUEST['pnid'];
}
$onlySelected = FALSE;
......
......@@ -282,6 +282,7 @@
});
$(".crm-dedupe-flip-selections").on('click', function(e) {
e.preventDefault();
var ids = [];
$('.crm-row-selected').each(function() {
var ele = CRM.$('input.crm-dedupe-select', this);
......@@ -289,7 +290,8 @@
});
if (ids.length > 0) {
var dataUrl = {/literal}"{crmURL p='civicrm/ajax/flipDupePairs' h=0 q='snippet=4'}"{literal};
CRM.$.post(dataUrl, {pnid: ids}, function (response) {
var request = $.post(dataUrl, {pnid: ids});
request.done(function(dt) {
var mapper = {1:3, 2:4, 5:6, 7:8, 9:10}
$('.crm-row-selected').each(function() {
var idx = $('table#dupePairs').DataTable().row(this).index();
......@@ -302,7 +304,7 @@
// keep the checkbox checked if needed
$('input.crm-dedupe-select', this).prop('checked', $(this).hasClass('crm-row-selected'));
});
}, 'json');
});
}
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment