From 7e9357ffbd733231b6ecd8cbd5d333bdbd0e7730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Thu, 7 Mar 2024 10:25:59 +0100 Subject: [PATCH] Editor / Distribution / Properly refresh list link on last one (#7844) Follow up of https://github.com/geonetwork/core-geonetwork/pull/7468 Refresh list when user remove the last link of a record. In that case md.link is undefined and we need to reload distributions. --- .../components/metadataactions/RelatedDirective.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js index 04bba86d128..02778297da3 100644 --- a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js +++ b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js @@ -486,14 +486,12 @@ scope.config = gnRelatedResources; scope.$watchCollection("md.link", function (n, o) { - if (n && n !== o) { - if (scope.md != null && scope.md.link) { - scope.loadDistributions(scope.md.link); - } + if (scope.md != null && n !== o) { + scope.loadDistributions(scope.md.link); } }); - if (scope.md != null && scope.md.link) { + if (scope.md != null) { scope.loadDistributions(scope.md.link); } }