gbif / hosted-portals

Support material for establishing the GBIF Hosted Portals
Apache License 2.0
10 stars 6 forks source link

filters fail if first adding an existence filter and then removing it again. #160

Closed MortenHofft closed 3 years ago

MortenHofft commented 3 years ago

To reproduce take recordedById. add a filter to only show records that have the field populated. apply. Then open the filter again and go back to regular search for an ID. This will throw an unhandled error rendering the screen blank.

MortenHofft commented 3 years ago

I've diagnosed the error. The problem is that the isNotNull filter is part of the initial options and hence tries to render as a regular string once the existence filter is removed.

We remember the initial options and render those to have past values easily accessible for the user in case they deselect by accidence. This problem will also occur in other filter types that remembers and render previous values (if we for example decided to allow existence type queries on taxon search)