From 134bbcb6b3c827fac862eeef64a0b0f26b78c7e0 Mon Sep 17 00:00:00 2001 From: colemanw Date: Fri, 7 Aug 2026 12:18:55 -0400 Subject: [PATCH] CustomField - Fix redirect after creating new group Regressed with e72b05ba54f1fe4 when the url changed but this line was missed. --- CRM/Custom/Form/Group.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/Custom/Form/Group.php b/CRM/Custom/Form/Group.php index e8c3410f181f..0d6ed12925eb 100644 --- a/CRM/Custom/Form/Group.php +++ b/CRM/Custom/Form/Group.php @@ -311,14 +311,12 @@ public function postProcess() { CRM_Core_Session::setStatus(ts('Your custom field set \'%1 \' has been saved.', [1 => $group['title']]), ts('Saved'), 'success'); } else { - // Jump directly to adding a field if popups are disabled - $action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? '' : '/add'; - $url = CRM_Utils_System::url("civicrm/admin/custom/group/field$action", 'reset=1&new=1&gid=' . $group['id']); + // Redirect to search display of fields + $url = Civi::url('civicrm/admin/custom/group/fields#/?gid=' . $group['id']); CRM_Core_Session::setStatus(ts("Your custom field set '%1' has been added. You can add custom fields now.", [1 => $group['title']] ), ts('Saved'), 'success'); - $session = CRM_Core_Session::singleton(); - $session->replaceUserContext($url); + CRM_Core_Session::singleton()->replaceUserContext((string) $url); } // prompt Drupal Views users to update $db_prefix in settings.php, if necessary