From: eileenmcnaugton Date: Sat, 22 Aug 2015 09:14:32 +0000 (+1200) Subject: CRM-12326 ensure is_deleted is applied to email search part X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7f6f3df1b3a71a07b29f117249db0acf9a51768c;p=civicrm-core.git CRM-12326 ensure is_deleted is applied to email search part --- diff --git a/api/v3/Contact.php b/api/v3/Contact.php index 9e9f754cd9..5f603974ef 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -906,7 +906,7 @@ function civicrm_api3_contact_getquick($params) { FROM civicrm_contact cc {$from} {$aclFrom} {$additionalFrom} {$includeEmailFrom} - {$emailWhere} + {$emailWhere} AND cc.is_deleted = 0 {$orderByInner} LIMIT 0, {$limit} ) diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index a892a89561..1d3937d37b 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -2186,6 +2186,21 @@ class api_v3_ContactTest extends CiviUnitTestCase { foreach ($expectedData as $index => $value) { $this->assertEquals($value, $result['values'][$index]['data']); } + $result = $this->callAPISuccess('contact', 'getquick', array( + 'name' => 'h.', + )); + $expectedData = array( + 'H Bobby, Bobby :: bob@h.com', + ); + foreach ($expectedData as $index => $value) { + $this->assertEquals($value, $result['values'][$index]['data']); + } + $this->callAPISuccess('Setting', 'create', array('includeWildCardInName' => FALSE)); + $result = $this->callAPISuccess('contact', 'getquick', array( + 'name' => 'h.', + )); + $this->callAPISuccess('Setting', 'create', array('includeWildCardInName' => TRUE)); + $this->assertEquals(0, $result['count']); } /**