Skip to content

Commit

Permalink
Merge pull request #17865 from colemanw/summary
Browse files Browse the repository at this point in the history
Fix potential js error on summary screen when reloading blocks
  • Loading branch information
eileenmcnaughton authored Jul 16, 2020
2 parents da4a382 + a567ff5 commit 87dacc5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions templates/CRM/Contact/Page/View/Summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@
function reloadBlock(el) {
return $(el).each(function() {
var data = $(this).data('edit-params');
data.snippet = data.reset = 1;
data.class_name = data.class_name.replace('Form', 'Page');
data.type = 'page';
$(this).closest('.crm-summary-block').load(CRM.url('civicrm/ajax/inline', data), function() {$(this).trigger('crmLoad');});
if (data) {
data.snippet = data.reset = 1;
data.class_name = data.class_name.replace('Form', 'Page');
data.type = 'page';
$(this).closest('.crm-summary-block').load(CRM.url('civicrm/ajax/inline', data), function() {
$(this).trigger('crmLoad');
});
}
});
}

Expand Down

0 comments on commit 87dacc5

Please sign in to comment.