Skip to content

Commit

Permalink
Merged in atrium-4281 (pull request civicrm#23)
Browse files Browse the repository at this point in the history
CRM-19092 fix issue where  can be '' rather than 0 so cid is not set properly
  • Loading branch information
seamuslee001 committed Aug 12, 2016
2 parents 04b7cf1 + 8e6395f commit 196729e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRM/Core/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ public static function validateMandatoryFields($fields, $values, &$errors) {
*/
public function getContactID() {
$tempID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
if (isset($this->_params) && isset($this->_params['select_contact_id'])) {
if (isset($this->_params) && !empty($this->_params['select_contact_id'])) {
$tempID = $this->_params['select_contact_id'];
}
if (isset($this->_params, $this->_params[0]) && !empty($this->_params[0]['select_contact_id'])) {
Expand All @@ -1599,6 +1599,7 @@ public function getContactID() {
// from that page
// we don't really need to set it when $tempID is set because the params have that stored
$this->set('cid', 0);
CRM_Core_Resources::singleton()->addVars('coreForm', array('contact_id' => (int) $tempID));
return (int) $tempID;
}

Expand Down

0 comments on commit 196729e

Please sign in to comment.