From 21da5ab4f02df6b4b198d5a88f75d7ab7cb66d98 Mon Sep 17 00:00:00 2001 From: Sebastian Zoglowek <55794780+zoglo@users.noreply.github.com> Date: Thu, 9 May 2024 22:38:07 +0200 Subject: [PATCH] Remove `feViewable` and use `feEditable` instead (fixes #21) --- contao/dca/tl_member.php | 1 - .../DataContainer/MemberFieldsOptionsListener.php | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/contao/dca/tl_member.php b/contao/dca/tl_member.php index 0c18967..f776e5b 100644 --- a/contao/dca/tl_member.php +++ b/contao/dca/tl_member.php @@ -37,7 +37,6 @@ 'inputType' => 'fileTree', 'eval' => [ 'feEditable' => true, - 'feViewable' => true, 'feGroup' => 'personal', 'fieldType' => 'radio', 'filesOnly' => true, diff --git a/src/EventListener/DataContainer/MemberFieldsOptionsListener.php b/src/EventListener/DataContainer/MemberFieldsOptionsListener.php index ed3b0ad..39d8c70 100644 --- a/src/EventListener/DataContainer/MemberFieldsOptionsListener.php +++ b/src/EventListener/DataContainer/MemberFieldsOptionsListener.php @@ -14,7 +14,7 @@ public function __construct() { } #[AsCallback(table: 'tl_module', target: 'fields.ext_orderField.options')] - public function getViewableMemberFields(): array + public function getEditableMemberFields(): array { $fields = []; @@ -23,8 +23,8 @@ public function getViewableMemberFields(): array if ( !empty($v['inputType']) && $k !== 'avatar' && - isset($v['eval']['feViewable']) && - $v['eval']['feViewable'] === true + isset($v['eval']['feEditable']) && + $v['eval']['feEditable'] === true ) { $fields[$k] = ($GLOBALS['TL_DCA']['tl_member']['fields'][$k]['label'][0] ?? $k) . ' ['.$k.']'; }