CRM-13883 - permanently delete contact should not remove activities if connected...
[civicrm-core.git] / CRM / Core / PseudoConstant.php
index ef8b6daca7e38bb897c0da2054afb4c779d612b1..1a2630d3beebe313b587a8a3e9104c4d1ed4684f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -233,7 +233,7 @@ class CRM_Core_PseudoConstant {
     $params += array(
       'grouping' => FALSE,
       'localize' => FALSE,
-      'onlyActive' => ($context == 'validate' || $context == 'create') ? FALSE : TRUE,
+      'onlyActive' => ($context == 'validate' || $context == 'get') ? FALSE : TRUE,
       'fresh' => FALSE,
     );
 
@@ -283,7 +283,7 @@ class CRM_Core_PseudoConstant {
     // Support "unique names" as well as sql names
     $fieldKey = $fieldName;
     if (empty($fields[$fieldKey])) {
-      $fieldKey = $fieldKeys[$fieldName];
+      $fieldKey = CRM_Utils_Array::value($fieldName, $fieldKeys);
     }
     // If neither worked then this field doesn't exist. Return false.
     if (empty($fields[$fieldKey])) {
@@ -1043,6 +1043,7 @@ WHERE  id = %1";
       while ($relationshipTypeDAO->fetch()) {
 
         self::$relationshipType[$valueColumnName][$relationshipTypeDAO->id] = array(
+          'id' => $relationshipTypeDAO->id,
           $column_a_b => $relationshipTypeDAO->$column_a_b,
           $column_b_a => $relationshipTypeDAO->$column_b_a,
           'contact_type_a' => "$relationshipTypeDAO->contact_type_a",