Open max-moser opened 1 year ago
For extra context, here's a count of how many of the ROR entries from the InvenioRDM cookiecutter have duplicates:
In [10]: len({k: v for k, v in counter_names.items() if v > 1})
Out[10]: 717
In [11]: len({k: v for k, v in counter_names.items() if v > 2})
Out[11]: 189
In [12]: len({k: v for k, v in counter_names.items() if v > 3})
Out[12]: 85
In [13]: len({k: v for k, v in counter_names.items() if v > 4})
Out[13]: 53
In [14]: len({k: v for k, v in counter_names.items() if v > 5})
Out[14]: 31
In [15]: len({k: v for k, v in counter_names.items() if v > 6})
Out[15]: 24
In [16]: len({k: v for k, v in counter_names.items() if v > 7})
Out[16]: 17
In [17]: len({k: v for k, v in counter_names.items() if v > 8})
Out[17]: 14
In [18]: len({k: v for k, v in counter_names.items() if v > 9})
Out[18]: 12
In [19]: {k: v for k, v in counter_names.items() if v > 10}
Out[19]:
{'Ministry of Health': 52,
'Government Medical College': 13,
"St. Luke's Hospital": 12,
'Institute of Physics': 11,
'Ministry of Justice': 17,
'Ministry of Education': 20,
'Ministry of Culture': 14,
'Ministry of Agriculture': 11,
'Ministry of Finance': 11,
'Ministry of Foreign Affairs': 16}
In [20]:
maybe when thinking about a solution it makes sense to also keep this issue in mind? https://github.com/inveniosoftware/invenio-app-rdm/issues/1868
might it be the case, that it makes sense, that in both cases a unique id would help to solve the problem?
Describe the bug
Whenever two affiliations have the same name, only one of the two (or more) entries is shown.
Steps to Reproduce
Expected behavior
The drop-down list should suggest both "Water Research Institute (IRSA)" as well as "Water Research Institute (WRI)".
Screenshots (if applicable)
Here, you can see that the backend does give back the WRI entry, but it's ignored in the web UI:![image](https://user-images.githubusercontent.com/6437519/230117811-29b32897-abda-4067-b7fd-b2e104b089f2.png)
Actually, we can see that both "Water Research Institute" entries are returned:![image](https://user-images.githubusercontent.com/6437519/230118097-2175d4f4-3453-479f-9dd5-751d70d4a0b7.png)
After renaming the IRSA entry to "Water Research Institute ITALIA", both entries are in the drop-down:![image](https://user-images.githubusercontent.com/6437519/230118350-5b896a54-ee91-4f2e-9026-2f720550a65d.png)
Additional context
Once again, @ppanero was invaluable with helping me check this bug out and pointed to the
key
being set to theaffiliation.name
rather than theid
: https://github.com/inveniosoftware/react-invenio-deposit/blob/master/src/lib/components/AffiliationsField.js#L23