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

[dataquery] CSV upload - CandID regex check #9722

Open
3 tasks done
adamdaudrich opened this issue Mar 19, 2025 · 0 comments · May be fixed by #9724
Open
3 tasks done

[dataquery] CSV upload - CandID regex check #9722

adamdaudrich opened this issue Mar 19, 2025 · 0 comments · May be fixed by #9724
Assignees
Labels
27.0.0 - Bugs Bugs Found in LORIS 27 testing Module: dataquery PR or issue related to (new) dataquery module
Milestone

Comments

@adamdaudrich
Copy link
Collaborator

adamdaudrich commented Mar 19, 2025

Describe the bug
Not so a much a bug as simply a confusing message.

To Reproduce
Steps to reproduce the behavior (attach screenshots if applicable):

  1. Go to reports / Data Query Tool (beta)
  2. Click on Continue to Define Fields
  3. Select CandID Loris Candidate identifier
  4. Select Add Filters from The Next Steps tab at bottom right of screen
  5. Click Import from CSV
  6. tick
  • Candidates
  • DDCID
  • Yes
  1. Import the following CSV file: pscid.csv

  2. The following error message is shown:

Image

What did you expect to happen?
This is a PSCID and not a DCCID, so, it will not pass the CandID regex check defined on line 35 of
https://github.com/aces/Loris/blob/main/modules/dataquery/jsx/definefilters.importcsvmodal.tsx

const candIDRegex = new RegExp('^[1-9][0-9]{5}$');
which is looking for 5 digits where first is not 0

and invoked on line 68 of the forloop (i think of this as a while loop)

I expected the error to be thrown at line 1 (index 0). I think the issue is that the governing function returns before this check takes place. So the following regex if-code block does not return after the first error. instead, it continues through the entire list because each error replaces the last one, and it will just give you the last row. So i think a second return statement should come after the CandID regex check.

Browser Environment (please complete the following information):

  • OS: Linux Ubuntu
  • Browser [firefox]
@adamdaudrich adamdaudrich added Module: dataquery PR or issue related to (new) dataquery module 27.0.0 - Bugs Bugs Found in LORIS 27 testing labels Mar 19, 2025
@adamdaudrich adamdaudrich added this to the 27.0.0 milestone Mar 19, 2025
@adamdaudrich adamdaudrich linked a pull request Mar 20, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
27.0.0 - Bugs Bugs Found in LORIS 27 testing Module: dataquery PR or issue related to (new) dataquery module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants