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

[Ref][Import] Start adding testing to validation, simplify #23415

Merged
merged 2 commits into from
May 10, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 9, 2022

Overview

[Ref][Import] Start adding testing to validation, simplify

This PR should result in the Preview process continuing to identify if name fields are missing with no change in behaviour

Before

  • no testing on the validation process
  • validation process follows a very confusing process whereby first it iterates through the fields & determines the 'index' for key fields and then checks that index in the $values array - which represents a row in the csv
  • second round of validation for required fields in the deprecated function - which originated from shared code

After

  • test
  • validation process acts on the $params once the $values row has been mapped to a $params - this means it can just check the params keys
  • second round of validation removed

Technical Details

This will be simplified once other open PRs - #23401 #23408 are merged

The second round of validation would have been required in the past for the related contacts (not currently checked in the first round) because it used to then call the Contact:create BAO directly - which didn't do validation. However, it now calls the v3 api - so the same exception would be thrown from the api as would be thrown from the second-round-validation

Comments

Anything else you would like the reviewer to note

@civibot
Copy link

civibot bot commented May 9, 2022

(Standard links)

@civibot civibot bot added the master label May 9, 2022
@eileenmcnaughton eileenmcnaughton force-pushed the import_valid branch 4 times, most recently from 5047d2b to c45cab3 Compare May 10, 2022 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants