Skip to content

Commit 196729e

Browse files
committed
Merged in atrium-4281 (pull request civicrm#23)
CRM-19092 fix issue where can be '' rather than 0 so cid is not set properly
2 parents 04b7cf1 + 8e6395f commit 196729e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CRM/Core/Form.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ public static function validateMandatoryFields($fields, $values, &$errors) {
15841584
*/
15851585
public function getContactID() {
15861586
$tempID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
1587-
if (isset($this->_params) && isset($this->_params['select_contact_id'])) {
1587+
if (isset($this->_params) && !empty($this->_params['select_contact_id'])) {
15881588
$tempID = $this->_params['select_contact_id'];
15891589
}
15901590
if (isset($this->_params, $this->_params[0]) && !empty($this->_params[0]['select_contact_id'])) {
@@ -1599,6 +1599,7 @@ public function getContactID() {
15991599
// from that page
16001600
// we don't really need to set it when $tempID is set because the params have that stored
16011601
$this->set('cid', 0);
1602+
CRM_Core_Resources::singleton()->addVars('coreForm', array('contact_id' => (int) $tempID));
16021603
return (int) $tempID;
16031604
}
16041605

0 commit comments

Comments
 (0)