From a97dab2725cf8b89c8e6314bfccdf047fa5b9866 Mon Sep 17 00:00:00 2001 From: Gabriel Felipe Soares Date: Wed, 4 Dec 2024 13:46:11 +0100 Subject: [PATCH 1/2] fix: add missing section filter on installation --- manifest.php | 2 + .../install/SetupSectionVisibilityFilters.php | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 scripts/install/SetupSectionVisibilityFilters.php diff --git a/manifest.php b/manifest.php index 321d367e..da4760e3 100755 --- a/manifest.php +++ b/manifest.php @@ -39,6 +39,7 @@ use oat\taoItems\scripts\install\RegisterAssetTreeBuilder; use oat\taoItems\scripts\install\RegisterItemPreviewerRegistryService; use oat\taoItems\scripts\install\SetupEventListeners; +use oat\taoItems\scripts\install\SetupSectionVisibilityFilters; /* * @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu} @@ -70,6 +71,7 @@ RegisterAssetTreeBuilder::class, SetRolesPermissions::class, SetupEventListeners::class, + SetupSectionVisibilityFilters::class ], ], 'update' => taoItems_scripts_update_Updater::class, diff --git a/scripts/install/SetupSectionVisibilityFilters.php b/scripts/install/SetupSectionVisibilityFilters.php new file mode 100644 index 00000000..65e5b0b6 --- /dev/null +++ b/scripts/install/SetupSectionVisibilityFilters.php @@ -0,0 +1,48 @@ +getServiceManager()->get(SectionVisibilityFilter::SERVICE_ID); + $sectionVisibilityFilter->showSectionByFeatureFlag( + $sectionVisibilityFilter->createSectionPath( + [ + 'manage_items', + 'item-translate' + ] + ), + 'FEATURE_FLAG_TRANSLATION_ENABLED' + ); + $this->getServiceManager()->register(SectionVisibilityFilter::SERVICE_ID, $sectionVisibilityFilter); + } +} From e957f683b21ad7e4c2bea34b4141e1751436e9cf Mon Sep 17 00:00:00 2001 From: Gabriel Felipe Soares Date: Wed, 4 Dec 2024 14:02:05 +0100 Subject: [PATCH 2/2] chore: annotations removal --- scripts/install/SetupSectionVisibilityFilters.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/install/SetupSectionVisibilityFilters.php b/scripts/install/SetupSectionVisibilityFilters.php index 65e5b0b6..364475e3 100644 --- a/scripts/install/SetupSectionVisibilityFilters.php +++ b/scripts/install/SetupSectionVisibilityFilters.php @@ -27,9 +27,6 @@ class SetupSectionVisibilityFilters extends InstallAction { - /** - * @param $params - */ public function __invoke($params) { /** @var SectionVisibilityFilter $sectionVisibilityFilter */