Migrate to new code
authorDonald A. Lobo <lobo@civicrm.org>
Tue, 30 Apr 2013 21:58:52 +0000 (14:58 -0700)
committerColeman Watts <coleman@civicrm.org>
Wed, 29 May 2013 21:32:23 +0000 (14:32 -0700)
CRM/Contact/BAO/Query.php
CRM/Core/OptionValue.php

index 2ac81c09a51c4a9e4c67313b30a6e9045c016a28..9112fbb98469e19ad9f3afd94c8f796b8a4c54b5 100644 (file)
@@ -587,7 +587,7 @@ class CRM_Contact_BAO_Query {
         continue;
       }
 
-      if ($field['pseudoconstant']) {
+      if (CRM_Utils_Array::value('pseudoconstant', $field)) {
         continue;
       }
 
@@ -1730,7 +1730,7 @@ class CRM_Contact_BAO_Query {
     elseif ($field['pseudoconstant']) {
       $this->optionValueQuery(
         $name, $op, $value, $grouping,
-        CRM_Core_PseudoConstant::{$field['pseudoconstant']['name']}(),
+        CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', $field['dbName']),
         $field,
         $field['title'],
         'String',
index d54ff87f904ec896ec0751d085bfa1d2b7ad4341..cd3a892e54ea6e5f0fb88843fe1c4c212d182f06 100644 (file)
@@ -323,6 +323,7 @@ class CRM_Core_OptionValue {
           $title = array(
             'gender' => array(
               'name' => 'gender',
+              'dbName' => 'gender_id',
               'title' => ts('Gender'),
               'headerPattern' => '/^gender$/i',
               'pseudoconstant' => $contactFields['gender_id']['pseudoconstant'],
@@ -330,6 +331,7 @@ class CRM_Core_OptionValue {
              ),
             'individual_prefix' => array(
               'name' => 'individual_prefix',
+              'dbName' => 'prefix_id',
               'title' => ts('Individual Prefix'),
               'headerPattern' => '/^(prefix|title)/i',
               'pseudoconstant' => $contactFields['prefix_id']['pseudoconstant'],
@@ -337,6 +339,7 @@ class CRM_Core_OptionValue {
             ),
             'individual_suffix' => array(
               'name' => 'individual_suffix',
+              'dbName' => 'suffix_id',
               'title' => ts('Individual Suffix'),
               'headerPattern' => '/^suffix$/i',
               'pseudoconstant' => $contactFields['suffix_id']['pseudoconstant'],