Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated org.dspace.discovery.configuration.DiscoveryConfiguration have different sets of search filters #482

Open
ciencia-abierta opened this issue Dec 17, 2024 · 0 comments
Labels

Comments

@ciencia-abierta
Copy link

ciencia-abierta commented Dec 17, 2024

Describe the bug

DSpace version: 2023.02.06

I'm going to start with the consequence of the bug and then explain the possible cause, maybe.

Projects are not linked to a person's profile project tab when the project metadata crisrp.investigator and crisrp.coinvestigator are filled with an authority.

I will assume the DSpace CRIS demo page has the same bug that I have in my personal DSpace instance. For example, the project DSpace-CRIS has two people with profiles, Bollini, Andrea and Mornati, Susanna, but their profile pages don't have the DSpace-CRIS project linked to them. There should be a "Projects" tab.


To Reproduce

Steps to reproduce the behavior (assuming inside a debug environment):

  1. Create a person profile inside DSpace.
  2. Create a project inside DSpace and add the person as the principal investigator.
  3. Put a debug breakpoint at line 212 inside ItemIndexFactoryImpl.java (This class is responsible for the creation of Solr fields associated with discovery.xml filters).
  4. Run an ./dspace index-discovery -b process to rebuild the Solr index.
  5. Inspect the discoveryConfigurations object.

The variable discoveryConfigurations contains all the configurations inside discovery.xml, but I noticed that, for some reason, there are two project configurations. Now ItemIndexFactoryImpl.java, when running its addDiscoveryFields() method, seems to handle the case of duplicated configurations by using the hash set appliedConf when cycling through all the configurations.

The problem is that there are duplicated project configurations that have different sets of searchFilters.

debug

For my case, the first project configuration has only 5 searchFilters, but the second has 8. One of the filters missing from the first configuration is searchFilterProjectInvestigator which create the Solr index field projectinvestigator:

<bean id="searchFilterProjectInvestigator"

first_conf

This filter appears in the second project configuration:

second_conf

The missing searchFilter is used by the query relationInvestigatorProjectsConfiguration, which lists all the person's projects.

Now, because ItemIndexFactoryImpl.java applied the first incomplete project configuration and skipped the second one, a person's projects will not be linked to their profile pages.

A special note should be that this problem will not happen if the order of configurations is inverted.


Expected behavior

Discovery configurations with the same ID should be identical and not have different attributes that can cause unexpected random behavior.

I hope this may explains the problem with unlinked person projects


Related work

None for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant