SirsiDynix Issues: Manual Stats Imports failing #328
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The hidden form at the bottom of uploadConfirmation.php does not contain a
startDate
&numMonths
value when manually importing stats file. This caused the scripts in uploadComplete.php(line 38-55) to incorrectly set the$multYear
var to true.Note about solution
To avoid any unnecessary meddling in how uploadConfirmation.php generates its variables, I decided to add additional logic to check for the existence of the
startDate
. As I understand it, there is a feature request to allow manual multi-year imports, at which point the logic for finding the start/end dates of an import file can be added. But this patch works until that development can be completed.iconv()
Additionally, it appears that
iconv()
in the Utility.php class has a (known bug)[http://php.net/manual/en/function.iconv.php#108643], which causes it to returnfalse
if it comes across an invalid character. This was cause the confirmation page to error out and not display any data to check. However, if the problem is not global across coral installs, that suggests the bug might be linked to OS and/or php version. Thus, instead of outright replacingiconv()
, I've added a check for an empty return, and (if true), it will run the file throughmb_convert_encoding()
instead.Review Procedure
Download the following sample files. File > Download as > Tab-separated values. Make sure the files have a
.txt
extensionJR1 R4 example
BR2 R4 example
BR1 R4 example
DB1 R4 example
OR
Use your own sample reports.
For each test file, in the Usage Module
Next, check that the SUSHI functionality didn't break: