From 49db91c1269dc8c2b5cdd0deed8b146121a49013 Mon Sep 17 00:00:00 2001 From: Ilias Dimopoulos Date: Thu, 5 Aug 2021 13:49:23 +0300 Subject: [PATCH 1/2] ISAICP-6637: Provide an update path for the abstract field for collections. --- .../joinup_core/joinup_core.post_update.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/web/modules/custom/joinup_core/joinup_core.post_update.php b/web/modules/custom/joinup_core/joinup_core.post_update.php index 031777be20..c48cacf228 100644 --- a/web/modules/custom/joinup_core/joinup_core.post_update.php +++ b/web/modules/custom/joinup_core/joinup_core.post_update.php @@ -14,3 +14,28 @@ */ declare(strict_types = 1); + +/** + * Implements hook_post_update_NAME(). + */ +function joinup_core_post_update_0107400(&$sandbox): void { + $graphs = [ + 'http://joinup.eu/collection/draft', + 'http://joinup.eu/collection/published', + ]; + + // This query updates the text format of the abstract field for collections. + // The field was updated to have a new sole format but the existing data were + // not updated. + foreach ($graphs as $graph) { + $query = << +DELETE { ?entity_id "basic_html"^^ } +INSERT { ?entity_id "essential_html"^^ } +WHERE { ?entity_id "basic_html"^^ } +QUERY; + + \Drupal::getContainer()->get('sparql.endpoint')->query($query); + } + +} From 57be28503cda06fe8b1964aa76c9e06eef9a80b2 Mon Sep 17 00:00:00 2001 From: Alexandre Dias Date: Thu, 12 Aug 2021 09:40:42 +0100 Subject: [PATCH 2/2] ISAICP-6637: Update description in hook_post_update_NAME. --- web/modules/custom/joinup_core/joinup_core.post_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/modules/custom/joinup_core/joinup_core.post_update.php b/web/modules/custom/joinup_core/joinup_core.post_update.php index c48cacf228..f0f75e7579 100644 --- a/web/modules/custom/joinup_core/joinup_core.post_update.php +++ b/web/modules/custom/joinup_core/joinup_core.post_update.php @@ -16,7 +16,7 @@ declare(strict_types = 1); /** - * Implements hook_post_update_NAME(). + * Update the text format of the abstract field for collections. */ function joinup_core_post_update_0107400(&$sandbox): void { $graphs = [