From 0242159928c20007bed0d78528658c6def1448b5 Mon Sep 17 00:00:00 2001 From: Ravi Gulhane Date: Fri, 16 Oct 2026 12:53:30 +0530 Subject: [PATCH] Changes --- app/Http/Controllers/FormController.php | 7 +++---- app/Http/Controllers/FormentityController.php | 6 ------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/FormController.php b/app/Http/Controllers/FormController.php index e28553b3..584cde81 100644 --- a/app/Http/Controllers/FormController.php +++ b/app/Http/Controllers/FormController.php @@ -12963,13 +12963,12 @@ class FormController extends Controller } /** - * Selected user attribute codes when the form is configured to show them. - * Uses the saved attribute list as the source of truth so columns still render - * if Show User Attributes was left off after attributes were selected. + * Selected user attribute codes when Show User Attributes is Yes. + * A saved attribute list is ignored while that setting is No. */ protected function userAttributeCodes($form): array { - if (!$form) { + if (!$form || ($form->show_user_attributes ?? 'no') !== 'yes') { return []; } $raw = $form->user_attributes ?? []; diff --git a/app/Http/Controllers/FormentityController.php b/app/Http/Controllers/FormentityController.php index f9a5ce7e..7b7eb08e 100644 --- a/app/Http/Controllers/FormentityController.php +++ b/app/Http/Controllers/FormentityController.php @@ -158,9 +158,6 @@ class FormentityController extends Controller $values->show_manager_details = $values->show_manager_details ?? 'no'; $values->show_user_attributes = (($values->show_user_attributes ?? 'no') === 'yes') ? 'yes' : 'no'; $values->user_attributes = $this->normalizeAttributeCodes($values->user_attributes ?? []); - if (!empty($values->user_attributes)) { - $values->show_user_attributes = 'yes'; - } } //echo '
'; print_r($values); exit;
         return $values;
@@ -254,9 +251,6 @@ class FormentityController extends Controller
         $data['roles_info'] = ($data['roles_info'] ?? 'no') === 'yes' ? 'yes' : 'no';
         $data['show_user_attributes'] = ($data['show_user_attributes'] ?? 'no') === 'yes' ? 'yes' : 'no';
         $data['user_attributes'] = $this->normalizeAttributeCodes($data['user_attributes'] ?? []);
-        if (!empty($data['user_attributes'])) {
-            $data['show_user_attributes'] = 'yes';
-        }
         if ($data['email_notification'] === 'no') {
             $data['email_notification_rules'] = [];
         } else {