-
Notifications
You must be signed in to change notification settings - Fork 12
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
Multiple ExportOptions...html files in exports stops the data from importing #268
Comments
Might be possible to allow the user to select which exportoptions is used...? SecuTrials metadata (e.g. the forms and items files) changes depending on the language, and the metadata is used when preparing the data (primarily with regards to preparing the date variables, if I remember correctly). Due to above, a warning would at least need to be issued... |
According to iAS, this is a bug in secuTrial's ExportSearchTool, related to:
This bug was fixed in December 2022 from secuTrial version 6.4.2 upwards. An error-free export will have a single ExportOptions.html file, hence a bugfix in secuTrialR is not necessary. |
The user reporting the issue was apparently using version 6.5.1.13... so either the bug has found it's way back in, or was never completely resolved (or something else is going on)... He also did a second export and had the same issue again. A relatively simple (partial) solution would be to check the number of ExportOptions files in the export and throw a more meaningful error message. Currently, it produces
which is not at all helpful. |
My comment was false, unfortunately! According to the change log of secuTrial version 6.3.2.4, a downloaded export will contain two ExportOptions.html files: One in the language set for the user account, and one in the language selected for this export. Only if both languages are identical, a single ExportOptions.html file is created. |
Thanks for looking into this, @DrEspresso... the exports in the package were made in 5.6.2.2, long before this became a feature... one of the problems with using static exports in tests, i suppose... we will certainly need a new export if we are to support these exports with multiple ExportOptions files... can you see if you can make such an export from one of the databases we already use (check the extdata folder)? |
@aghaynes Sure, no problem! I exported s_export_CSV-xls_CTU05_all_info.zip last year in secuTrial version 6.5.1.5 to test the different delimiter options in CSV exports. It only contains ExportOptions_en.html. I now re-exported it with export language German, first while keeping the user language English (ExportOptions_de.html and ExportOptions_en.html), and a second time with user language set to French (ExportOptions_de.html and ExportOptions_fr.html). |
Describe the bug
Bug report from a user:
I got a secuTrial export from my IT-Department, that contains two files for the export options, see screenshot.
When I call secuTrialR::read_secuTrial on this zip-file, i get an error.
I think, the function secuTrialR:::read_export_options causes the error.
These lines of this function may cause the error:
files <- unzip(data_dir, list = TRUE)
study_options_file_idx <- grep("ExportOptions", files$Name)
file_con <- unz(data_dir, files$Name[study_options_file_idx])
study_options_file_idx has two entries instead of one. So unz() failes.
Perhaps you could change
files$Name[study_options_file_idx]
to
files$Name[study_options_file_idx [1] ]
To Reproduce
No possible
Expected behavior
Exports should be able to import data even if there are multiple ExportOptions
Screenshots

Additional context
NA
The text was updated successfully, but these errors were encountered: