4Science / DSpace

This repository contains the 4Science optimized DSpace & DSpace-CRIS distribution.
https://wiki.lyrasis.org/display/DSPACECRIS/
BSD 3-Clause "New" or "Revised" License
43 stars 62 forks source link

Controlled Vocabulary plugin options are not applied #321

Closed floriangantner closed 1 year ago

floriangantner commented 1 year ago

Describe the bug The controlled vocabulary options are not applied.

To Reproduce Steps to reproduce the behavior:

  1. configure some controlled vocabulary _plugin
  2. Apply any of this configuration options differing from the default value
    vocabulary.plugin._plugin_.hierarchy.store = <false>    # default: true
    # vocabulary.plugin._plugin_.hierarchy.suggest = <true>  # default: false
    # vocabulary.plugin._plugin_.delimiter = "<string>"            # default: "::"
    ##
  3. None of the options are applied correctly, because in case of _plugin the https://github.com/4Science/DSpace/blob/92d75ea37dd81408a49f74767d3a4d33d21b2e40/d[…]-api/src/main/java/org/dspace/core/LegacyPluginServiceImpl.java PluginService looks for some ChoiceAuthority named ChoiceAuthority_plugin, which is also found. It creates some DSpaceControlledVocabulary, but the setPluginInstanceName(.) /vocabularyName is set after the constructor(), so the https://github.com/4Science/DSpace/blob/92d75ea37dd81408a49f74767d3a4d33d21b2e40/d[…]va/org/dspace/content/authority/DSpaceControlledVocabulary.java vocabularyName is null and the wrong config parameters are considered.
  4. To proof the null value in the constructor you might set vocabulary.plugin.null.hierarchy.store = false and watch any impact
  5. The normal DSpace uses some slightly different constructor (https://github.com/DSpace/DSpace/blob/b956bcd3891e372cc0fe5b1595e422e5d059bced/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java#L78), so this is some DSpace-Cris related problem.

Expected behavior Options are applied with correct settings

Related work Link to any related tickets or PRs here. Link to discussion in Slack-Channel (will disappear soon) https://dspace-org.slack.com/archives/CBTMASJP3/p1673648152466329

floriangantner commented 1 year ago

it seems for me this issue has been fixed with https://github.com/4Science/DSpace/commit/eeffa00e08b66222c5d0e9cc16d073c9d03547ad#diff-46ce462737aecd30f6e70e07c415b82ea3a0b31945058406147cad5b09df4f64