Additional fix
authormonishdeb <monish.deb@webaccessglobal.com>
Tue, 2 Sep 2014 07:56:08 +0000 (13:26 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Tue, 2 Sep 2014 07:56:08 +0000 (13:26 +0530)
CRM/Contribute/Form/Contribution/Main.php

index 3c2ee8fecd7eee36f5da4cfed225e3de79f29ab2..bc0fd4a79a983abf34aaf0553a3393113e50ac3b 100644 (file)
@@ -842,13 +842,13 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
               $priceFieldIDS[] = $fields['price_' . $priceId];
             }
 
-            if (CRM_Utils_Array::value('options', $value)  && (
-                ($fields['price_' . $priceId] == $val['id']) ||
-                (isset($fields['price_' . $priceId]) && !empty($fields['price_' . $priceId][$val['id']]))
-              )
-            ) {
+            if (CRM_Utils_Array::value('options', $value)) {
               foreach ($value['options'] as $val) {
-                if (CRM_Utils_Array::value('membership_type_id', $val)) {
+                if (CRM_Utils_Array::value('membership_type_id', $val)  && (
+                    ($fields['price_' . $priceId] == $val['id']) ||
+                    (isset($fields['price_' . $priceId]) && !empty($fields['price_' . $priceId][$val['id']]))
+                  )
+                ) {
                   $priceFieldMemTypes[] = $val['membership_type_id'];
                 }
               }