From 7086c6007bda28b12b8ae7363aae1a00ea15422a Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 8 Jun 2020 10:29:32 +1000 Subject: [PATCH] Add note in about depraction of CRM_Core_Error::fatal --- docs/extensions/index.md | 8 ++++++++ docs/security/inputs.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/extensions/index.md b/docs/extensions/index.md index cf2af528..38c42b1c 100644 --- a/docs/extensions/index.md +++ b/docs/extensions/index.md @@ -74,3 +74,11 @@ Fully supported methods are: * Internal Symfony listeners (e.g. `civi.api.resolve`, `civi.api.prepare`) See also this [blog post](https://civicrm.org/blog/totten/the-static-is-dead-long-live-the-static) describing the `Civi::` facade in more detail. + +### Deprecated Methods + +Some methods within the CiviCRM Code base that extension developers have been relying on have now been deprecated: + + * `CRM_Core_Error::fatal` + Extension authors should replace fucntion calls with either `throw new CRM_Core_Exception` or `throw new ` or `CRM_Core_Error::statusBounce` if the error is being generaged from a form. + diff --git a/docs/security/inputs.md b/docs/security/inputs.md index b5dd83a9..5fe36a9d 100644 --- a/docs/security/inputs.md +++ b/docs/security/inputs.md @@ -25,7 +25,7 @@ If you find yourself wanting to use the `'String'` type, beware that this type o ```php $angPage = CRM_Utils_Request::retrieve('angPage', 'String', $this); if (!preg_match(':^[a-zA-Z0-9\-_/]+$:', $angPage)) { - CRM_Core_Error::fatal('Malformed return URL'); + throw new CRM_Core_Exception('Malformed return URL'); } ```