diff --git a/.opts.yml b/.opts.yml index 6ba43c612e139f80de47548c1c556d1ee3f45888..1ae028cf4454d397330211560079da99b9d31cbf 100644 --- a/.opts.yml +++ b/.opts.yml @@ -15,16 +15,11 @@ upgrade_commands: - vendor/bin/drush joinup:unpublish-alert --category - scripts/check_status_report.php append: - production: - # TODO: Remove this command in ISAICP-9053. - - vendor/bin/drush state:set joinup.oss_catalogue_is_disabled 1 --input-format=boolean acceptance: - touch disable-config-readonly - vendor/bin/drush joinup:acc - vendor/bin/drush cache:rebuild - rm disable-config-readonly - # TODO: Remove this command in ISAICP-9053. - - vendor/bin/drush state:set joinup.oss_catalogue_is_disabled 1 --input-format=boolean ephemeral: - touch disable-config-readonly - vendor/bin/drush joinup:acc diff --git a/tests/features/communities/oss_catalogue/oss_catalogue.feature b/tests/features/communities/oss_catalogue/oss_catalogue.feature index fa76710b689b804a12101def8b008beeeb440c72..212e6362810f37b04b4be6e7b9eb1cd462850245 100644 --- a/tests/features/communities/oss_catalogue/oss_catalogue.feature +++ b/tests/features/communities/oss_catalogue/oss_catalogue.feature @@ -1,4 +1,4 @@ -@api @group-clone +@api @group-clone @eu-oss-catalogue Feature: In order to present the details about EU OSS catalogue I want to view a dedicated collection and landing page diff --git a/tests/features/communities/oss_catalogue/oss_catalogue.relevant_language.feature b/tests/features/communities/oss_catalogue/oss_catalogue.relevant_language.feature index db9bfc45038d0a0173186e98f8766f48d7a5f6ce..b4c5fb9ce17ea87e8b95a6cf5c9254aa27c8bad3 100644 --- a/tests/features/communities/oss_catalogue/oss_catalogue.relevant_language.feature +++ b/tests/features/communities/oss_catalogue/oss_catalogue.relevant_language.feature @@ -1,4 +1,4 @@ -@api @group-clone +@api @group-clone @eu-oss-catalogue Feature: In order to show the most data to visitors, EU OSS Catalogue provides a special equivalent of the OSS Solution's translatable fields which fetch and diff --git a/tests/features/communities/oss_catalogue/oss_catalogue_visibility.feature b/tests/features/communities/oss_catalogue/oss_catalogue_visibility.feature index de3d282ba23f562d8d49a2cd4299d86c63b7bd6f..d1970cbae437fd1f3bc1733b67a824a4a8f96534 100644 --- a/tests/features/communities/oss_catalogue/oss_catalogue_visibility.feature +++ b/tests/features/communities/oss_catalogue/oss_catalogue_visibility.feature @@ -7,44 +7,6 @@ Feature: Test EU OSS Catalogue killswitch | title | oss_development_status | oss_source | oss_categories | oss_short_description | status | | The Opensource Panacea | development | developers_italia | content-management | The cure | published | - When I go to "/eu-oss-catalogue" - Then the response status code should be 200 - But I should not see "Sign in to continue" - And I go to "/eu-oss-catalogue/solutions" - Then the response status code should be 200 - But I should not see "Sign in to continue" - And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" - Then the response status code should be 200 - But I should not see "Sign in to continue" - - Given I am logged in as an "authenticated" - When I go to "/eu-oss-catalogue" - And I check "I agree to the Legal notice document" - And I press "Submit" - Then the response status code should be 200 - And I go to "/eu-oss-catalogue/solutions" - Then the response status code should be 200 - And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" - Then the response status code should be 200 - - Given I am logged in as a "developer" - When I go to "/eu-oss-catalogue" - Then the response status code should be 200 - And I go to "/eu-oss-catalogue/solutions" - Then the response status code should be 200 - And I go to "/admin/content/eu-oss-catalogue" - Then the response status code should be 200 - And I go to "/admin/content/eu-oss-catalogue/oss-solutions" - Then the response status code should be 200 - And I go to "/admin/content/eu-oss-catalogue/log" - Then the response status code should be 200 - And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" - Then the response status code should be 200 - - Given I visit "/dashboard" - When I press "Disable EU OSS Catalogue" - Then I should see the success message "EU OSS Catalogue has been disabled" - Given I am an anonymous user When I go to "/eu-oss-catalogue" Then I should see the heading "Sign in to continue" @@ -52,6 +14,8 @@ Feature: Test EU OSS Catalogue killswitch Then I should see the heading "Sign in to continue" And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" Then I should see the heading "Sign in to continue" + When I am on the homepage + Then I should not see "EU Open Source Solutions Catalogue" Given I am logged in as an "authenticated" When I go to "/eu-oss-catalogue" @@ -62,6 +26,8 @@ Feature: Test EU OSS Catalogue killswitch Then the response status code should be 403 And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" Then the response status code should be 403 + When I am on the homepage + Then I should not see "EU Open Source Solutions Catalogue" Given I am logged in as a "developer" When I go to "/eu-oss-catalogue" @@ -77,6 +43,8 @@ Feature: Test EU OSS Catalogue killswitch # Developer is and amin role, they can still see the node. And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" Then the response status code should be 200 + When I am on the homepage + Then I should not see "EU Open Source Solutions Catalogue" Given I visit "/dashboard" When I press "Enable EU OSS Catalogue" @@ -94,6 +62,8 @@ Feature: Test EU OSS Catalogue killswitch Then the response status code should be 200 And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" Then the response status code should be 200 + When I am on the homepage + Then I should see "EU Open Source Solutions Catalogue" Given I am an anonymous user When I go to "/eu-oss-catalogue" @@ -105,6 +75,8 @@ Feature: Test EU OSS Catalogue killswitch And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" Then the response status code should be 200 But I should not see "Sign in to continue" + When I am on the homepage + Then I should see "EU Open Source Solutions Catalogue" Given I am logged in as an "authenticated" When I go to "/eu-oss-catalogue" @@ -115,3 +87,48 @@ Feature: Test EU OSS Catalogue killswitch Then the response status code should be 200 And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" Then the response status code should be 200 + When I am on the homepage + Then I should see "EU Open Source Solutions Catalogue" + + Given I am logged in as a "developer" + When I visit "/dashboard" + And I press "Disable EU OSS Catalogue" + Then I should see the success message "EU OSS Catalogue has been disabled" + + When I go to "/eu-oss-catalogue" + Then the response status code should be 403 + And I go to "/eu-oss-catalogue/solutions" + Then the response status code should be 403 + And I go to "/admin/content/eu-oss-catalogue" + Then the response status code should be 403 + And I go to "/admin/content/eu-oss-catalogue/oss-solutions" + Then the response status code should be 403 + And I go to "/admin/content/eu-oss-catalogue/log" + Then the response status code should be 403 + # Developer is and amin role, they can still see the node. + And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" + Then the response status code should be 200 + When I am on the homepage + Then I should not see "EU Open Source Solutions Catalogue" + + Given I am an anonymous user + When I go to "/eu-oss-catalogue" + Then I should see the heading "Sign in to continue" + And I go to "/eu-oss-catalogue/solutions" + Then I should see the heading "Sign in to continue" + And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" + Then I should see the heading "Sign in to continue" + When I am on the homepage + Then I should not see "EU Open Source Solutions Catalogue" + + Given I am logged in as an "authenticated" + When I go to "/eu-oss-catalogue" + And I check "I agree to the Legal notice document" + And I press "Submit" + Then the response status code should be 403 + And I go to "/eu-oss-catalogue/solutions" + Then the response status code should be 403 + And I go to the content page of the type "oss_solution" with the title "The Opensource Panacea" + Then the response status code should be 403 + When I am on the homepage + Then I should not see "EU Open Source Solutions Catalogue" diff --git a/tests/src/Context/JoinupOSSSolutionContext.php b/tests/src/Context/JoinupOSSSolutionContext.php index 8f392676e1e91df6a6c9353b03da35ed8b95246b..1bc4b5a9807fe3848018967848c32f7c04296f1e 100644 --- a/tests/src/Context/JoinupOSSSolutionContext.php +++ b/tests/src/Context/JoinupOSSSolutionContext.php @@ -5,15 +5,12 @@ namespace Drupal\joinup\Context; use Drupal\DrupalExtension\Context\RawDrupalContext; -use Drupal\joinup\Traits\EntityTrait; /** * Behat step definitions for testing OSS solution. */ class JoinupOSSSolutionContext extends RawDrupalContext { - use EntityTrait; - /** * OSS welcome page path. */ @@ -52,4 +49,26 @@ public static function disableOssCron(): void { $state->set('eu_oss_catalogue.last_check', strtotime('- 1 hour')); } + /** + * Enables EU OSS Catalogue functionality. + * + * @BeforeScenario @api&&@eu-oss-catalogue + * + * @todo Remove this method and all @eu-oss-catalogue tags in ISAICP-9053. + */ + public function enableEuOssCatalogue(): void { + joinup_oss_catalogue_toggle('enable'); + } + + /** + * Disables EU OSS Catalogue functionality. + * + * @AfterScenario @api&&@eu-oss-catalogue + * + * @todo Remove this method and all @eu-oss-catalogue tags in ISAICP-9053. + */ + public function disableEuOssCatalogue(): void { + joinup_oss_catalogue_toggle('disable'); + } + } diff --git a/web/modules/custom/dashboard/src/Form/DashboardForm.php b/web/modules/custom/dashboard/src/Form/DashboardForm.php index 0c0a74d9098a74612df358c64a5aec2923ca8e63..0f02afb9307fe2efd2c98c72a2581548a75793f6 100644 --- a/web/modules/custom/dashboard/src/Form/DashboardForm.php +++ b/web/modules/custom/dashboard/src/Form/DashboardForm.php @@ -6,6 +6,8 @@ use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Database\Connection; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; @@ -13,6 +15,7 @@ use Drupal\Core\Url; use Drupal\joinup_core\Logger\Handler\MailHandler; use Drupal\joinup_core\Logger\Handler\TelegramHandler; +use Drupal\rdf_sync\RdfSyncConnectionInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -23,6 +26,9 @@ class DashboardForm extends FormBase { public function __construct( protected StateInterface $state, protected CacheBackendInterface $pageCache, + protected EntityTypeManagerInterface $entityTypeManager, + protected RdfSyncConnectionInterface $rdfSyncConnection, + protected Connection $db, ) { } @@ -33,6 +39,9 @@ public static function create(ContainerInterface $container): self { return new static( $container->get('state'), $container->get('cache.page'), + $container->get('entity_type.manager'), + $container->get('rdf_sync.connection'), + $container->get('database'), ); } @@ -105,14 +114,14 @@ public function buildForm(array $form, FormStateInterface $form_state): array { '#type' => 'submit', '#value' => $this->t('Enable EU OSS Catalogue'), '#submit' => ['::enableEuOssCatalogueSubmitForm'], - '#access' => $hasEnableDisablePermission && !joinup_oss_catalogue_is_enabled(), + '#access' => $hasEnableDisablePermission && !joinup_oss_catalogue_feature()->isAllowed(), ]; // @todo Remove this button in ISAICP-9053. $form['actions']['disable'] = [ '#type' => 'submit', '#value' => $this->t('Disable EU OSS Catalogue'), '#submit' => ['::disableEuOssCatalogueSubmitForm'], - '#access' => $hasEnableDisablePermission && joinup_oss_catalogue_is_enabled(), + '#access' => $hasEnableDisablePermission && joinup_oss_catalogue_feature()->isAllowed(), ]; return $form; @@ -124,7 +133,7 @@ public function buildForm(array $form, FormStateInterface $form_state): array { * @todo Remove this method in ISAICP-9053. */ public function enableEuOssCatalogueSubmitForm(): void { - $this->state->delete('joinup.oss_catalogue_is_disabled'); + joinup_oss_catalogue_toggle('enable'); // Only clear cache for anonymous. $this->pageCache->deleteAll(); $this->messenger()->addStatus($this->t('EU OSS Catalogue has been enabled')); @@ -136,7 +145,7 @@ public function enableEuOssCatalogueSubmitForm(): void { * @todo Remove this method in ISAICP-9053. */ public function disableEuOssCatalogueSubmitForm(): void { - $this->state->set('joinup.oss_catalogue_is_disabled', TRUE); + joinup_oss_catalogue_toggle('disable'); // Only clear cache for anonymous. $this->pageCache->deleteAll(); $this->messenger()->addStatus($this->t('EU OSS Catalogue has been disabled')); diff --git a/web/modules/custom/joinup_communities/joinup_oss_catalogue/joinup_oss_catalogue.install b/web/modules/custom/joinup_communities/joinup_oss_catalogue/joinup_oss_catalogue.install index 8de55f0c533be8000fa8748bfd737656825e9c4b..a91e60a0c8e6974506a62c3621637d8cf62bbc4b 100644 --- a/web/modules/custom/joinup_communities/joinup_oss_catalogue/joinup_oss_catalogue.install +++ b/web/modules/custom/joinup_communities/joinup_oss_catalogue/joinup_oss_catalogue.install @@ -18,3 +18,23 @@ function joinup_oss_catalogue_update_200001(): void { $collection->skip_notification = TRUE; $collection->set('field_ar_state', 'published')->save(); } + +/** + * Fix OSS Catalogue collection fields. + */ +function joinup_oss_catalogue_update_200002(): void { + joinup_oss_catalogue_toggle('disable'); + + $collection = \Drupal::entityTypeManager()->getStorage('rdf_entity') + ->load(OssCatalogueCollectionInterface::COLLECTION_ENTITY_ID); + $collection->skip_notification = TRUE; + $collection->set('field_topic', 11195)->save(); + + \Drupal::getContainer()->get('entity.repository') + ->loadEntityByUuid('node', OssCatalogueCollectionInterface::LANDING_PAGE) + ->set('field_topic', 11195) + ->save(); + + // We're not using anymore this switch. + \Drupal::state()->delete('joinup.oss_catalogue_is_disabled'); +} diff --git a/web/modules/custom/joinup_communities/joinup_oss_catalogue/joinup_oss_catalogue.module b/web/modules/custom/joinup_communities/joinup_oss_catalogue/joinup_oss_catalogue.module index 8212527be9fd2c44c856ef9a4e6facb2ff2bdd1f..9eedf4aabbad681ed7a730263d8b204ce29903a9 100644 --- a/web/modules/custom/joinup_communities/joinup_oss_catalogue/joinup_oss_catalogue.module +++ b/web/modules/custom/joinup_communities/joinup_oss_catalogue/joinup_oss_catalogue.module @@ -20,6 +20,7 @@ use Drupal\joinup_oss_catalogue\Entity\JoinupOssSolution; use Drupal\joinup_oss_catalogue\OssCatalogueCollectionInterface; use Drupal\node\NodeInterface; +use Solarium\Core\Query\Helper; /** * Implements hook_views_plugins_argument_alter(). @@ -190,13 +191,25 @@ function joinup_oss_catalogue_preprocess_views_view__eu_oss_catalogue_admin_caro /** * Checks whether the EU OSS Catalogue functionality is enabled. * - * @return bool - * Whether the EU OSS Catalogue functionality is enabled. + * @return \Drupal\Core\Access\AccessResultInterface + * Access result. * * @todo Remove this function in ISAICP-9053. */ -function joinup_oss_catalogue_is_enabled(): bool { - return !\Drupal::state()->get('joinup.oss_catalogue_is_disabled', FALSE); +function joinup_oss_catalogue_feature(): AccessResultInterface { + static $cache; + if (!isset($cache)) { + $collection = \Drupal::entityTypeManager()->getStorage('rdf_entity') + ->load(OssCatalogueCollectionInterface::COLLECTION_ENTITY_ID); + if (!$collection instanceof CollectionInterface) { + $cache = AccessResult::allowed(); + } + else { + $state = $collection->get('field_ar_state')->first()->getValue()['value'] ?? NULL; + $cache = AccessResult::allowedIf($state === 'published')->addCacheableDependency($collection); + } + } + return $cache; } /** @@ -214,7 +227,7 @@ function joinup_oss_catalogue_entity_access(EntityInterface $entity): AccessResu ($entity instanceof OssSolutionInterface) ) { return AccessResult::forbiddenIf( - !joinup_oss_catalogue_is_enabled(), + !joinup_oss_catalogue_feature()->isAllowed(), 'EU OSS Catalogue is disabled', )->addCacheableDependency($entity); } @@ -241,9 +254,65 @@ function joinup_oss_catalogue_module_implements_alter(array &$implementations, s * @todo Remove this function in ISAICP-9053. */ function joinup_oss_catalogue_cron(): void { - if (joinup_oss_catalogue_is_enabled()) { + if (joinup_oss_catalogue_feature()->isAllowed()) { // Only run if EU OSS Catalogue functionality is enabled. eu_oss_catalogue_cron(); eu_oss_vitality_index_cron(); } } + +/** + * Toggles the state of EU OSS Catalogue functionality. + * + * @param string $toggle + * The state: 'enable', 'disable'. + * + * @todo Remove this function in ISAICP-9053. + */ +function joinup_oss_catalogue_toggle(string $toggle): void { + assert(in_array($toggle, ['enable', 'disable'], TRUE)); + + $entityTypeManager = \Drupal::entityTypeManager(); + $uri = OssCatalogueCollectionInterface::COLLECTION_ENTITY_ID; + if (!$collection = $entityTypeManager->getStorage('rdf_entity')->load($uri)) { + // If the EU OSS Catalogue collection is missing exit there's nothing to do. + return; + } + + $collection->skip_notification = TRUE; + $state = $toggle === 'enable' ? 'published' : 'draft'; + $collection->set('field_ar_state', $state)->save(); + + if ($toggle === 'disable') { + // Unfortunately, we don't have an API to unpublish a collection because + // when setting the state field to 'draft', we're creating a forward + // revision and the published version still exist and is shown on UIs. In + // order to unpublish, we perform the following operations: + // - Remove the published triples. + // - Remove the document from Solr and from search_api_item table. + $sparql = <<<SPARQL + WITH <http://joinup.eu/collection/published> + DELETE { <$uri> ?p ?o } + WHERE { <$uri> ?p ?o } + SPARQL; + \Drupal::getContainer()->get('rdf_sync.connection')->update($sparql); + $sapiId = 'entity:rdf_entity/' . $uri; + $solrHelper = new Helper(); + /** @var \Drupal\search_api_solr\SolrConnectorInterface $connector */ + $connector = $entityTypeManager->getStorage('search_api_server')->load('joinup') + ->getBackend() + ->getSolrConnector(); + $deleteQuery = $connector + ->getUpdateQuery() + ->addDeleteQuery('ss_search_api_id:' . $solrHelper->escapePhrase($sapiId)) + ->addCommit(); + $connector->update($deleteQuery); + \Drupal::database()->delete('search_api_item') + ->condition('index_id', ['published', 'unpublished'], 'IN') + ->condition('item_id', $sapiId) + ->execute(); + } + + // The 'Explore' block caches is time-based (6h). Explicitly clear the cache. + \Drupal::getContainer()->get('cache_tags.invalidator')->invalidateTags(['homepage_explore_block']); +} diff --git a/web/modules/custom/joinup_communities/joinup_oss_catalogue/src/Access/KillSwitchCheck.php b/web/modules/custom/joinup_communities/joinup_oss_catalogue/src/Access/KillSwitchCheck.php index 5c68df86ad23a526d89f9acc5dfc5ffb5b7be707..b7f3a3772372cc200626f3780875208b86332131 100644 --- a/web/modules/custom/joinup_communities/joinup_oss_catalogue/src/Access/KillSwitchCheck.php +++ b/web/modules/custom/joinup_communities/joinup_oss_catalogue/src/Access/KillSwitchCheck.php @@ -4,7 +4,6 @@ namespace Drupal\joinup_oss_catalogue\Access; -use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; @@ -33,7 +32,7 @@ public function access(Route $route, RouteMatchInterface $routeMatch): AccessRes if ($requirement !== 'TRUE') { throw new \Exception("The _eu_oss_catalogue_check_enabled route requirement when present can only have 'TRUE' as value but '$requirement' was given."); } - return joinup_oss_catalogue_is_enabled() ? AccessResult::allowed() : AccessResult::forbidden('EU OSS Catalogue functionality is disabled'); + return joinup_oss_catalogue_feature(); } } diff --git a/web/modules/custom/joinup_communities/joinup_oss_catalogue/src/Drush/Commands/JoinupOssCatalogueCommands.php b/web/modules/custom/joinup_communities/joinup_oss_catalogue/src/Drush/Commands/JoinupOssCatalogueCommands.php index 78e167c5de1a1825e12e3ffd7fef21e748aac977..6c5ca7220124115bc8c39593b93e7c6a8deb69f0 100644 --- a/web/modules/custom/joinup_communities/joinup_oss_catalogue/src/Drush/Commands/JoinupOssCatalogueCommands.php +++ b/web/modules/custom/joinup_communities/joinup_oss_catalogue/src/Drush/Commands/JoinupOssCatalogueCommands.php @@ -40,7 +40,7 @@ public function __construct( */ #[CLI\Hook(type: HookManager::REPLACE_COMMAND_HOOK, target: 'eu-oss:fetch')] public function fetch(string $provider): string { - if (joinup_oss_catalogue_is_enabled()) { + if (joinup_oss_catalogue_feature()->isAllowed()) { $commands = new EuOssCatalogueCommands($this->euOssCatalogueService, $this->providerPluginManager); return $commands->fetch($provider); } @@ -52,7 +52,7 @@ public function fetch(string $provider): string { */ #[CLI\Hook(type: HookManager::REPLACE_COMMAND_HOOK, target: 'eu-oss:generate-vitality-index')] public function generate(string $nid): string { - if (joinup_oss_catalogue_is_enabled()) { + if (joinup_oss_catalogue_feature()->isAllowed()) { $commands = new EuOssVitalityIndexCommands($this->vitalityIndexGenerator, $this->entityTypeManager); return $commands->generate($nid); } diff --git a/web/modules/custom/joinup_core/src/Commands/JoinupDataSanitizationCommands.php b/web/modules/custom/joinup_core/src/Commands/JoinupDataSanitizationCommands.php index 8734c8dff365ce1acda7ce8a5552212badbcb57e..fc64beb5af89e32ea69ca2e40d78c7003b216957 100644 --- a/web/modules/custom/joinup_core/src/Commands/JoinupDataSanitizationCommands.php +++ b/web/modules/custom/joinup_core/src/Commands/JoinupDataSanitizationCommands.php @@ -47,8 +47,6 @@ public function sanitize($result, CommandData $commandData): void { $this->sanitizeLogAlertsSettings(); $this->sanitizeEmailConfirmerData(); $this->sanitizeDownloadEventData(); - // @todo Remove this call in ISAICP-9053. - $this->sanitizeEuOssCatalogueSwitcher(); } /** @@ -62,8 +60,6 @@ public function messages(&$messages, InputInterface $input): void { $messages[] = dt('Sanitize log alerts settings.'); $messages[] = dt('Sanitize email confirmer data.'); $messages[] = dt('Sanitize download event data.'); - // @todo Remove this message in ISAICP-9053. - $messages[] = dt('Sanitize EU OSS Catalogue switcher.'); } /** @@ -183,17 +179,4 @@ protected function sanitizeEntityFieldsData(string $entityType, array $fieldName } } - /** - * Sanitizes the EU OSS Catalogue switcher. - * - * @todo Remove this method in ISAICP-9053. - */ - protected function sanitizeEuOssCatalogueSwitcher(): void { - $this->db->delete('key_value') - ->condition('collection', 'state') - ->condition('name', 'joinup.oss_catalogue_is_disabled') - ->execute(); - $this->logger()->success(dt('joinup.oss_catalogue_is_disabled state var sanitized.')); - } - } diff --git a/web/modules/custom/joinup_front_page/src/Plugin/Block/ExploreBlock.php b/web/modules/custom/joinup_front_page/src/Plugin/Block/ExploreBlock.php index 2a23ee1dca7f97874b9f36d53667b319e5a72556..bd560af3acada18c9de2a46ed56e8d1e25d4b08d 100644 --- a/web/modules/custom/joinup_front_page/src/Plugin/Block/ExploreBlock.php +++ b/web/modules/custom/joinup_front_page/src/Plugin/Block/ExploreBlock.php @@ -138,7 +138,7 @@ public function getCacheTags(): array { // whenever any of the content types shown in it change. The front page is // heavily trafficked and too frequent cache invalidations might affect // performance. - return []; + return ['homepage_explore_block']; } /**