From 02b9c72a8f3f1999d5ca15bcb935387b2fb505ad Mon Sep 17 00:00:00 2001 From: Md Nadim Hossain Date: Tue, 4 Aug 2026 13:39:07 +1000 Subject: [PATCH 1/2] [SD-1634] Added update hook to hide custom filters that does not have any component selected. --- tide_core.install | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tide_core.install b/tide_core.install index 75c599a47..1ce88a633 100644 --- a/tide_core.install +++ b/tide_core.install @@ -5,6 +5,7 @@ * Installation functions for Tide Core. */ +use Drupal\Core\Entity\Entity\EntityFormDisplay; use Drupal\field\Entity\FieldConfig; use Drupal\metatag\Entity\MetatagDefaults; use Drupal\node\Entity\Node; @@ -1683,3 +1684,37 @@ function tide_core_update_10046() { } } } + +/** + * Clean up Paragraph fields without handler settings from form displays. + */ +function tide_core_update_10047() { + /** @var \Drupal\field\Entity\FieldConfig[] $field_configs */ + $field_configs = FieldConfig::loadMultiple(); + $updated_displays = []; + + foreach ($field_configs as $field_config) { + $handler = $field_config->getSetting('handler'); + $handler_settings = $field_config->getSetting('handler_settings'); + + if ($handler === 'default:paragraph' && empty($handler_settings)) { + $entity_type = $field_config->getTargetEntityTypeId(); + $bundle = $field_config->getTargetBundle(); + $field_name = $field_config->getName(); + + // Explicit string concatenation + $form_display_id = $entity_type . '.' . $bundle . '.default'; + + $form_display = EntityFormDisplay::load($form_display_id); + + if ($form_display) { + $component = $form_display->getComponent($field_name); + + if ($component !== NULL) { + $form_display->removeComponent($field_name); + $form_display->save(); + } + } + } + } +} From cee772148f2f51a675b97e54fbe47d11175cce06 Mon Sep 17 00:00:00 2001 From: Md Nadim Hossain Date: Tue, 4 Aug 2026 14:09:19 +1000 Subject: [PATCH 2/2] Lint fix. --- tide_core.install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tide_core.install b/tide_core.install index 1ce88a633..9ad002c27 100644 --- a/tide_core.install +++ b/tide_core.install @@ -1702,9 +1702,8 @@ function tide_core_update_10047() { $bundle = $field_config->getTargetBundle(); $field_name = $field_config->getName(); - // Explicit string concatenation $form_display_id = $entity_type . '.' . $bundle . '.default'; - + $form_display = EntityFormDisplay::load($form_display_id); if ($form_display) {