From c1fa3349062099219ad496eea43367deab5a7b6c Mon Sep 17 00:00:00 2001 From: Ludovic DANIEL Date: Mon, 16 Sep 2024 23:11:22 +0200 Subject: [PATCH 1/2] Fix NPE using CVOC --- .../java/edu/harvard/iq/dataverse/search/IndexServiceBean.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java index fe8f1030f82..a8cf9ed519b 100644 --- a/src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java @@ -1128,7 +1128,7 @@ public SolrInputDocuments toSolrDocs(IndexableDataset indexableDataset, Set childDatasetFields = dsf.getParentDatasetFieldCompoundValue().getChildDatasetFields(); for (DatasetField df : childDatasetFields) { - if(cvocManagedFieldMap.get(dsfType.getId()).contains(df.getDatasetFieldType().getName())) { + if(cvocManagedFieldMap.containsKey(dsfType.getId()) && cvocManagedFieldMap.get(dsfType.getId()).contains(df.getDatasetFieldType().getName())) { String solrManagedFieldSearchable = df.getDatasetFieldType().getSolrField().getNameSearchable(); // Try to get string values from externalvocabularyvalue but for a managed fields of the CVOCConf Set stringsForManagedField = datasetFieldService.getIndexableStringsByTermUri(val, cvocMap.get(dsfType.getId()), df.getDatasetFieldType().getName()); From 6d9d6777ae37e0105285a3c73afff771170082b4 Mon Sep 17 00:00:00 2001 From: Ludovic DANIEL Date: Mon, 23 Sep 2024 16:19:03 +0200 Subject: [PATCH 2/2] add release note --- doc/release-notes/10869-fix-npe-using-cvoc.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/release-notes/10869-fix-npe-using-cvoc.md diff --git a/doc/release-notes/10869-fix-npe-using-cvoc.md b/doc/release-notes/10869-fix-npe-using-cvoc.md new file mode 100644 index 00000000000..53214d3789d --- /dev/null +++ b/doc/release-notes/10869-fix-npe-using-cvoc.md @@ -0,0 +1 @@ +This release fixes a bug in the external controlled vocabulary mechanism (introduced in v6.3) that could cause indexing to fail when a script is configured for one child field and no other child fields were managed. \ No newline at end of file