Skip to content

Commit

Permalink
Fix issue with the merge button
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaantony92 committed Oct 6, 2023
1 parent 60876dc commit e525090
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/Resources/public/admin/js/cmf.js
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,12 @@ app.SearchFilter.DateRangePicker = (function () {
$(document).ready(function() {
window.app.init($('body'));

$('#customerDuplicatesMerge').on('click', function () {
const duplicateIds = $('#customerDuplicatesMerge').data('duplicate-ids');
new window.top.pimcore.plugin.objectmerger.panel(duplicateIds[0], duplicateIds[1]);
const duplicates = $('.customer-duplicates-merge');
$.each(duplicates , function(index,duplicate) {
duplicate.addEventListener('click', (event) => {
const duplicateIds = JSON.parse(duplicate.dataset.duplicate_ids);
new window.top.pimcore.plugin.objectmerger.panel(duplicateIds[0], duplicateIds[1]);
});
});
});
})(jQuery);
2 changes: 1 addition & 1 deletion src/Resources/views/admin/duplicates/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<tbody id="customerduplicates_{{ duplicate.getDuplicateCustomers[0].getId() }}_{{ duplicate.getDuplicateCustomers[1].getId() }}" class="js-duplicates-item duplicates-item" >
<tr>
<td colspan="99">
<a class="btn btn-primary btn-xs pull-right" id="customerDuplicatesMerge" data-duplicate-ids='[{{ duplicate.getDuplicateCustomers[0].getId() }},{{ duplicate.getDuplicateCustomers[1].getId() }}]'>
<a class="btn btn-primary btn-xs pull-right customer-duplicates-merge" data-duplicate_ids='[{{ duplicate.getDuplicateCustomers[0].getId() }},{{ duplicate.getDuplicateCustomers[1].getId() }}]'>
{{ 'cmf_duplicates_merge' | trans({}, 'admin') }}
</a>
{% if(not app.request.get('declined')) %}
Expand Down

0 comments on commit e525090

Please sign in to comment.