From d5ecf8e2d1ccf9769517a837f8807521792e31fa Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 23 Jul 2016 08:36:17 +1000 Subject: [PATCH] Fix Syntax Conformance Test by setting values for Test Data --- CRM/Contact/BAO/Group.php | 18 +++++++++++++++++- CRM/Contact/BAO/GroupContactCache.php | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 093703eb0a..3a52eecb69 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -506,7 +506,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * and store it for future use */ public function buildClause() { - $params = array(array('group', 'IN', array($this->id => 1), 0, 0)); + $params = array(array('group', 'IN', array($this->id), 0, 0)); if (!empty($params)) { $tables = $whereTables = array(); @@ -1306,4 +1306,20 @@ WHERE {$whereClause}"; return CRM_Utils_PagerAToZ::getAToZBar($dao, $this->_sortByCharacter, TRUE); } + /** + * Assign Test Value. + * + * @param string $fieldName + * @param array $fieldDef + * @param int $counter + */ + protected function assignTestValue($fieldName, &$fieldDef, $counter) { + if ($fieldName == 'children' || $fieldName = 'parents') { + $this->{$fieldName} = "NULL"; + } + else { + parent::assignTestValues($fieldaName, $fieldDef, $counter); + } + } + } diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index 7174c55f48..92c0bc1f6c 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -221,7 +221,7 @@ AND g.refresh_date IS NULL $returnProperties = array('contact_id'); foreach ($groupID as $gid) { - $params = array(array('group', 'IN', array($gid => 1), 0, 0)); + $params = array(array('group', 'IN', array($gid), 0, 0)); // the below call updates the cache table as a byproduct of the query CRM_Contact_BAO_Query::apiQuery($params, $returnProperties, NULL, NULL, 0, 0, FALSE); } -- 2.25.1