coral-erm / coral

CORAL ERM main repository
http://coral-erm.org/
Other
52 stars 64 forks source link

hard-coded organization roles in resources search #563

Open t4k opened 5 years ago

t4k commented 5 years ago

We ran into an issue that took quite the detective work to figure out.

It turns out that the Publisher (contains), Platform (contains), and Provider (contains) fields in the sidebar of the Resources module are all hardcoded to the ID values that are set upon initial install.

We had deleted them and added new ones, eventually naming them similarly to the originals, but they had new IDs in the database. (This is in Organizations > Admin > Organization Role.)

This led to users saying "I know there are resources with the Provider listed as ACME, Inc., but they do not come back in search results when searching in the Provider field."

See the code in resources/admin/classes/domain/Resource.php

https://github.com/coral-erm/coral/blob/528fa1719d8d926653d848092e55fbc02fa4c42d/resources/admin/classes/domain/Resource.php#L725-L727

https://github.com/coral-erm/coral/blob/528fa1719d8d926653d848092e55fbc02fa4c42d/resources/admin/classes/domain/Resource.php#L738-L740

https://github.com/coral-erm/coral/blob/528fa1719d8d926653d848092e55fbc02fa4c42d/resources/admin/classes/domain/Resource.php#L751-L753

Solution Ideas

I can think of a few ideas to overcome this flaw.

veggiematts commented 5 years ago

I would go for the first solution:

However, we may want to have a dropdown list with the roles instead of multiple search fields. Unless we want to be able to search on different roles at the same time (do we ?)

t4k commented 5 years ago

@veggiematts I think your question is a good one to pose to members of the coral-user list.