From 17a5f733607c357d2fd6de3422fd033723ca169b Mon Sep 17 00:00:00 2001 From: Herb v/d Dool Date: Wed, 11 Jan 2023 09:48:39 -0500 Subject: [PATCH] add :bool and update comments --- CRM/Core/BAO/UFGroup.php | 3 +-- CRM/Utils/System/Base.php | 2 +- CRM/Utils/System/Drupal8.php | 4 ++-- CRM/Utils/System/DrupalBase.php | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 5cbb50cc7e..e9bbdadb34 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -916,8 +916,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup implements \Civi\Core\Ho $template = CRM_Core_Smarty::singleton(); - // Hide CRM error messages if they are set based on CMS - // criteria. + // Hide CRM error messages if they are set by the CMS. if (!empty($_POST)) { $supressForm = CRM_Core_Config::singleton()->userSystem->suppressProfileFormErrors(); $template->assign('suppressForm', $supressForm); diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php index 553cb333bd..9b435b22d8 100644 --- a/CRM/Utils/System/Base.php +++ b/CRM/Utils/System/Base.php @@ -1119,7 +1119,7 @@ abstract class CRM_Utils_System_Base { * * @return bool */ - public function suppressProfileFormErrors() { + public function suppressProfileFormErrors():bool { return FALSE; } diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index 445b4ebbb4..30d2b5f012 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -904,9 +904,9 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { /** * @inheritdoc */ - public function suppressProfileFormErrors() { + public function suppressProfileFormErrors():bool { // Suppress the errors if they are displayed using - // drupal form_set_error. + // setErrorByName method on FormStateInterface. $current_path = \Drupal::service('path.current')->getPath(); $path_args = explode('/', $current_path); if ($path_args[1] == 'user' || ($path_args[1] == 'admin' && $path_args[2] == 'people')) { diff --git a/CRM/Utils/System/DrupalBase.php b/CRM/Utils/System/DrupalBase.php index c0e567a4b2..102f3fa76e 100644 --- a/CRM/Utils/System/DrupalBase.php +++ b/CRM/Utils/System/DrupalBase.php @@ -724,9 +724,9 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { /** * @inheritdoc */ - public function suppressProfileFormErrors() { + public function suppressProfileFormErrors():bool { // Suppress the errors if they are displayed using - // drupal form_set_error. + // form_set_error. if (arg(0) == 'user' || (arg(0) == 'admin' && arg(1) == 'people')) { return TRUE; } -- 2.25.1