Merge pull request #2091 from colemanw/navigation
[civicrm-core.git] / api / v3 / MailingGroup.php
index 0c9f4ddc42c5037909c6ca15678c3a9c34efde4e..7bcf9d2aab6b3760390736507880e59b07d8541b 100644 (file)
@@ -1,9 +1,8 @@
 <?php
-// $Id$
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
  *
  */
 
-/**
- * Files required for this package
- */
-
-
-
-require_once 'CRM/Contact/BAO/Group.php';
-require_once 'CRM/Mailing/Event/BAO/Queue.php';
-require_once 'CRM/Mailing/Event/BAO/Subscribe.php';
-require_once 'CRM/Mailing/Event/BAO/Unsubscribe.php';
-require_once 'CRM/Mailing/Event/BAO/Resubscribe.php';
-require_once 'CRM/Mailing/Event/BAO/TrackableURLOpen.php';
-
 /**
  * Handle an unsubscribe event
  * @deprecated
@@ -65,6 +51,7 @@ function civicrm_api3_mailing_group_event_unsubscribe($params) {
 
 /**
  * Handle a site-level unsubscribe event
+ * @deprecated
  *
  * @param array $params
  *
@@ -101,19 +88,21 @@ function civicrm_api3_mailing_group_event_subscribe($params) {
 
 function civicrm_api3_mailing_group_getfields($params) {
   $dao = _civicrm_api3_get_DAO('Subscribe');
-  $file = str_replace('_', '/', $dao) . ".php";
-  require_once ($file);
   $d = new $dao();
   $fields = $d->fields();
   $d->free();
 
   $dao = _civicrm_api3_get_DAO('Unsubscribe');
-  $file = str_replace('_', '/', $dao) . ".php";
-  require_once ($file);
   $d = new $dao();
   $fields = $fields + $d->fields();
   $d->free();
 
+  // CRM-13830 - prevent the api wrapper from helping out with pseudoconstants
+  // Since these fields don't belong to this entity it will fail
+  foreach ($fields as &$field) {
+    unset($field['pseudoconstant']);
+  }
+
   return civicrm_api3_create_success($fields);
 }