CRM-15510 param retrieval issue
authorEileen McNaughton <eileen@fuzion.co.nz>
Tue, 21 Oct 2014 22:01:45 +0000 (11:01 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Tue, 21 Oct 2014 22:07:06 +0000 (11:07 +1300)
Conflicts:
CRM/Event/Page/AJAX.php

CRM/Event/Cart/Page/CheckoutAJAX.php
CRM/Event/Page/AJAX.php

index bef47d294f07a7d831810bfee47a671f6ea5d61c..8b8bc275035a7a73840c33fbc4de5393d5306919 100644 (file)
@@ -5,12 +5,11 @@
  */
 class CRM_Event_Cart_Page_CheckoutAJAX {
   function add_participant_to_cart() {
-    require 'CRM/Core/Transaction.php';
     $transaction = new CRM_Core_Transaction();
-    $cart_id     = $_GET['cart_id'];
-    $event_id    = $_GET['event_id'];
+    $cart_id = CRM_Utils_Request::retrieve('cart_id', 'Integer');
+    $event_id = CRM_Utils_Request::retrieve('event_id', 'Integer');
 
-    $cart = CRM_Event_Cart_BAO_Cart::find_by_id($_GET['cart_id']);
+    $cart = CRM_Event_Cart_BAO_Cart::find_by_id($cart_id);
 
          $params_array = array('cart_id' => $cart->id, 'contact_id' => CRM_Event_Cart_Form_Cart::find_or_create_contact(), 'event_id' => $event_id);
 
@@ -43,7 +42,8 @@ class CRM_Event_Cart_Page_CheckoutAJAX {
   }
 
   function remove_participant_from_cart() {
-    $participant = CRM_Event_Cart_BAO_MerParticipant::get_by_id($_GET['id']);
+    $id = CRM_Utils_Request::retrieve('id', 'Integer');
+    $participant = CRM_Event_Cart_BAO_MerParticipant::get_by_id($id);
     $participant->delete();
 
     CRM_Utils_System::civiExit();
index 530201327180692f31e30ce19292308b913fd4d4..24d05da96a55d2bf948f1acf34ba5906fbe6a3ec 100644 (file)
@@ -66,6 +66,5 @@ GROUP BY cv.label";
     }
     CRM_Utils_JSON::output($results);
   }
-
 }