// Update mode (always single)
if ($this->_action & CRM_Core_Action::UPDATE) {
+ $update = TRUE;
$params['id'] = $this->_relationshipId;
$ids['relationship'] = $this->_relationshipId;
$relation = CRM_Contact_BAO_Relationship::getRelationshipByID($this->_relationshipId);
// Save the relationships.
$outcome = CRM_Contact_BAO_Relationship::createMultiple($params, $relationshipTypeParts[1]);
$relationshipIds = $outcome['relationship_ids'];
+ if (empty($outcome['saved']) && !empty($update)) {
+ $outcome['saved'] = $update;
+ }
$this->setMessage($outcome);
// if this is called from case view,
* - 'saved' : boolean of whether save was successful
*/
protected function setMessage($outcome) {
- if (!empty($outcome['valid'])) {
+ if (!empty($outcome['valid']) && empty($outcome['saved'])) {
CRM_Core_Session::setStatus(ts('Relationship created.', array(
'count' => $outcome['valid'],
'plural' => '%count relationships created.',