From: Donald A. Lobo Date: Tue, 30 Apr 2013 20:38:03 +0000 (-0700) Subject: Get export working X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=314dbef8489d09483c1cfc5981b17068fdc50f55;p=civicrm-core.git Get export working --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index c930717567..2ac81c09a5 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -30,7 +30,7 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2013 * $Id$ -nnnnnnnnn * + * */ /** @@ -587,6 +587,10 @@ class CRM_Contact_BAO_Query { continue; } + if ($field['pseudoconstant']) { + continue; + } + // redirect to activity select clause if (substr($name, 0, 9) == 'activity_') { CRM_Activity_BAO_Query::select($this); @@ -909,7 +913,7 @@ class CRM_Contact_BAO_Query { } } - // check if there is a value, if so also add to where Clause + // Check if there is a value, if so also add to where Clause $addWhere = FALSE; if ($this->_params) { $nm = $elementName; @@ -1198,6 +1202,7 @@ class CRM_Contact_BAO_Query { $this->filterRelatedContacts($from, $where, $having); } + // CRM_Core_Error::debug($this); return array($select, $from, $where, $having); } diff --git a/CRM/Core/OptionValue.php b/CRM/Core/OptionValue.php index a665413d12..d54ff87f90 100644 --- a/CRM/Core/OptionValue.php +++ b/CRM/Core/OptionValue.php @@ -371,8 +371,11 @@ class CRM_Core_OptionValue { static function select(&$query) { if (!empty($query->_params) || !empty($query->_returnProperties)) { $field = self::getFields(); - foreach ($field as $name => $title) { - list($tableName, $fieldName) = explode('.', $title['where']); + foreach ($field as $name => $values) { + if ($values['pseudoconstant']) { + continue; + } + list($tableName, $fieldName) = explode('.', $values['where']); if (CRM_Utils_Array::value($name, $query->_returnProperties)) { $query->_select["{$name}_id"] = "{$name}.value as {$name}_id"; $query->_element["{$name}_id"] = 1;