Issue 1984 - make caches ID specific.
authorStephen Palmstrom <stephen.palmstrom@missionassist.org.uk>
Wed, 11 Jan 2023 17:42:37 +0000 (17:42 +0000)
committerStephen Palmstrom <stephen.palmstrom@missionassist.org.uk>
Wed, 11 Jan 2023 17:42:37 +0000 (17:42 +0000)
CRM/Core/BAO/UFGroup.php

index c7d1b83e46f741f80fa12abadaacdfaad865c8e3..03c38ba36c7a74ab804d1543a90376aac4f47cff 100644 (file)
@@ -918,12 +918,11 @@ 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 displayed using drupal form_set_error.
-        if (!empty($_POST) && CRM_Core_Config::singleton()->userFramework == 'Drupal') {
-          if (arg(0) == 'user' || (arg(0) == 'admin' && arg(1) == 'people')) {
-            $template->assign('suppressForm', TRUE);
+        // 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);
           }
-        }
 
         $templateFile = "CRM/Profile/Form/{$profileID}/Dynamic.tpl";
         if (!$template->template_exists($templateFile)) {