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

"Fail hard" is too hard #8319

Closed
wants to merge 1 commit into from
Closed

"Fail hard" is too hard #8319

wants to merge 1 commit into from

Conversation

yurg
Copy link
Contributor

@yurg yurg commented May 8, 2016

Had to make changes in order to restore project from Fatal Error; Please, please, some more mercy next time via crm.alert /
CRM_Core_Session::setStatus instead of firing exceptions.

Had to make changes in order to restore project from  Fatal Error; Please, please,  some more mercy next time via  crm.alert / 
CRM_Core_Session::setStatus instead of firing exceptions.
@civicrm-builder
Copy link

Can one of the admins verify this patch?

@colemanw
Copy link
Member

colemanw commented May 8, 2016

The BAO is responsible for business logic (that's what the "B" stands for) and not presentation. So throwing an exception is more appropriate for the BAO than reaching into the user's session to set a status message (which would not be an appropriate action to take e.g. if the BAO was being called from the api). Generally what we want to do is catch the exception in the form layer and present a nice error message to the user.

@xurizaemon
Copy link
Member

xurizaemon commented May 8, 2016

See CRM-18504 and PR #8301 also.

Comments here don't pass code style either - I understand that wasn't top priority when your site exploded 😄

@xurizaemon
Copy link
Member

This patch is not OK - it appears to restore a SQL injection vulnerability addressed in 4.7.7. Please follow the issue linked above which I will be working on today.

@colemanw colemanw closed this May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants