Commit 92c49df4 authored by Rich's avatar Rich
Browse files

Fix issue #9

parent 93abe1d0
......@@ -104,10 +104,18 @@ class CRM_Civigiftaid_SetContributionGiftAidEligibility {
// Assume not eligible until proven eligible.
$eligibility = 0;
// We need to look through line items to determine if any of them are eligible.
foreach ($contribution['line_items'] as $lineItem) {
if (self::financialTypeIsEligible($lineItem['financial_type_id'])) {
if (empty($contribution['line_items'])) {
// Issue #9: Sometimes line_itmes are not returned!
if (self::financialTypeIsEligible($contribution['financial_type_id'])) {
$eligibility = 1;
break;
}
}
else {
foreach ($contribution['line_items'] as $lineItem) {
if (self::financialTypeIsEligible($lineItem['financial_type_id'])) {
$eligibility = 1;
break;
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment