From 1d4206487468fc137607f919133f2694063d2cb8 Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Tue, 17 Dec 2024 11:07:50 +0200 Subject: [PATCH] UHF-10713: Fix update hook if module is not installed of config is missing --- helfi_api_base.install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helfi_api_base.install b/helfi_api_base.install index c4105a0..ca57c80 100644 --- a/helfi_api_base.install +++ b/helfi_api_base.install @@ -343,8 +343,12 @@ function _helfi_api_base_process_links(ContentEntityInterface $entity, string $f * UHF-10713 Remove VersionChecker. */ function helfi_api_base_update_9023(): void { + if (!\Drupal::moduleHandler()->moduleExists('rest')) { + return; + } + \Drupal::entityTypeManager() ->getStorage('rest_resource_config') ->load('helfi_debug_package_version') - ->delete(); + ?->delete(); }