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

Fixed start_date and end_date in user importer #15148

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

marcusmoore
Copy link
Collaborator

Description

This PR fixes an issue involving start and end dates in the user importer.

If a row being imported does not have a start or end date, whether that is due to it not being mapped or not being included in the import at all, the fields would end up in the database as 0000-00-00 instead of null. T

This is due to the findCsvMatch method returning an empty string if the column is present but empty and/or calling trim on null returning an empty string.

This PR simply changes start_date and end_date fields to null if they have been set to an empty string after the initial matching/mapping.

Fixes #15141

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Copy link

what-the-diff bot commented Jul 23, 2024

PR Summary

  • Introduction of New Method for Managing Dates
    A new function handleEmptyStringsForDates() has been introduced to improve data handling. This function comes in handy when we encounter empty strings in our date fields, namely, start_date and end_date. Instead of keeping them as empty strings, which can lead to confusion and inconsistencies in our data, this method converts these empty strings to a neutral, more consistent value: null. This ensures a reliable, cleaner dataset which can enhance data analysis and result in more accurate insights.

@snipe snipe merged commit 57b5b12 into snipe:develop Jul 23, 2024
9 checks passed
@marcusmoore marcusmoore deleted the fixes/dates-in-user-import branch July 23, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants