This commit is contained in:
Ravi Gulhane 2026-10-16 12:53:30 +05:30
parent 0ed9417ace
commit 0242159928
2 changed files with 3 additions and 10 deletions

View File

@ -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 ?? [];

View File

@ -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 '<pre>'; 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 {