Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19739 : New Account Relationship Option Screen does not show excep… #10651

Merged
merged 3 commits into from
Aug 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CRM/Financial/BAO/FinancialTypeAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ public static function createDefaultFinancialAccounts($financialType) {
*
* @param obj $financialTypeAccount of CRM_Financial_DAO_EntityFinancialAccount
*
* @throws CRM_Core_Exception
*/
public static function validateRelationship($financialTypeAccount) {
$financialAccountLinks = CRM_Financial_BAO_FinancialAccount::getfinancialAccountRelations();
Expand All @@ -282,7 +283,7 @@ public static function validateRelationship($financialTypeAccount) {
$params = array(
1 => $accountRelationships[$financialTypeAccount->account_relationship],
);
throw new Exception(ts("This financial account cannot have '%1' relationship.", $params));
throw new CRM_Core_Exception(ts("This financial account cannot have '%1' relationship.", $params));
}
}

Expand Down
9 changes: 7 additions & 2 deletions CRM/Financial/Form/FinancialTypeAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,13 @@ public function postProcess() {
if ($this->_action & CRM_Core_Action::ADD) {
$params['entity_id'] = $this->_aid;
}
$financialTypeAccount = CRM_Financial_BAO_FinancialTypeAccount::add($params, $ids);
CRM_Core_Session::setStatus(ts('The financial type Account has been saved.'));
try {
$financialTypeAccount = CRM_Financial_BAO_FinancialTypeAccount::add($params, $ids);
CRM_Core_Session::setStatus(ts('The financial type Account has been saved.'), ts('Saved'), 'success');
}
catch (CRM_Core_Exception $e) {
CRM_Core_Error::statusBounce($e->getMessage());
}
}

$buttonName = $this->controller->getButtonName();
Expand Down