Skip to content

Commit

Permalink
Merge pull request #10870 from Recherche-Data-Gouv/10869-fix-cvoc-npe
Browse files Browse the repository at this point in the history
Fix NPE using CVOC
  • Loading branch information
pdurbin authored Sep 23, 2024
2 parents cabc9c0 + 6d9d677 commit 2bdc7b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/release-notes/10869-fix-npe-using-cvoc.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ public SolrInputDocuments toSolrDocs(IndexableDataset indexableDataset, Set<Long
if(dsfType.getParentDatasetFieldType()!=null) {
List<DatasetField> 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<String> stringsForManagedField = datasetFieldService.getIndexableStringsByTermUri(val, cvocMap.get(dsfType.getId()), df.getDatasetFieldType().getName());
Expand Down

0 comments on commit 2bdc7b3

Please sign in to comment.