fix bug on new contributions submitted from non-logged in user

This commit is contained in:
Jon Goldberg 2019-01-14 23:20:56 -05:00
parent a4ba86b09e
commit fe8053a414
Signed by: jon
GPG Key ID: 0DC025928E9AA851

View File

@ -286,10 +286,12 @@ function _batchexportperm_civicrm_allow_contribution_to_edit($contributionId) {
'custom_group_id' => "batchexportperm_batch_details", 'custom_group_id' => "batchexportperm_batch_details",
'name' => "export_date", 'name' => "export_date",
]); ]);
$exportDate = civicrm_api3('Contribution', 'getvalue', [ $exportDate = civicrm_api3('Contribution', 'get', [
'return' => "custom_{$customFieldId}", 'return' => "custom_{$customFieldId}",
'id' => $contributionId, 'id' => $contributionId,
]); 'sequential' => 1,
])['values'][0]["custom_{$customFieldId}"];
CRM_Core_Error::debug('exportdate', $exportDate);
if (empty($exportDate) || CRM_Core_Permission::check('edit exported contributions')) { if (empty($exportDate) || CRM_Core_Permission::check('edit exported contributions')) {
return TRUE; return TRUE;
} }