Skip to content

Conversation

@knirirr
Copy link
Contributor

@knirirr knirirr commented Oct 8, 2025

It's not clear why some strings aren't being quoted if they contain brackets, but I have written code to add them to an array if detected which can work around the problem.

@knirirr knirirr changed the title Cover scenario where value is already splittable. #2648 Fix bracket bug. #2648 Oct 8, 2025
@knirirr knirirr linked an issue Oct 8, 2025 that may be closed by this pull request
Copy link
Contributor

@ramGranell ramGranell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When checking the organisations with parenthesis "Austrian Science Fund (fwf), Asutria" it keeps not returning anything:
https://deploy-preview-2649--fairsharing.netlify.app/search?page=1&organisations=austrian%2520science%2520fund%2520%28fwf%29%252C%2520austria

when there are three records linked to it as it can be seen here: https://deploy-preview-2649--fairsharing.netlify.app/organisations/154

The case of High performance computing works properly: https://deploy-preview-2649--fairsharing.netlify.app/search?userDefinedTags=high%2520performance%2520computing%2520%28hpc%29&page=1

Other organistion with parenthesis works https://deploy-preview-2649--fairsharing.netlify.app/search?organisations=european%2520union%2520%28eu%29&page=1 Is it possible that it fails as it has parenthesis and comma as your code does a split by comma?

@knirirr
Copy link
Contributor Author

knirirr commented Oct 8, 2025

Is it possible that it fails as it has parenthesis and comma as your code does a split by comma?

Possibly. I can remove that but who knows what other weird issues may crop up later?

// attempt to fix single fields with brackets, as per:
// https://github.com/FAIRsharing/fairsharing.github.io/issues/2648
Object.keys(params).forEach((key) => {
if (String(params[key]).includes('(') || String(params[key]).includes(')')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible could you please try params[key] = [params[key]], instead of creating an array variable and pushing and assigning

Copy link
Contributor

@ramGranell ramGranell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seems now to work properly

@knirirr knirirr merged commit dc6170d into dev Oct 8, 2025
5 checks passed
@knirirr knirirr deleted the bracket_bug_2648 branch October 8, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem when searching strings with "(" or ")"

4 participants