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

CSV import fails on DataObjects that use validation #8449

Open
mikeyc7m opened this issue Oct 4, 2018 · 2 comments
Open

CSV import fails on DataObjects that use validation #8449

mikeyc7m opened this issue Oct 4, 2018 · 2 comments

Comments

@mikeyc7m
Copy link
Contributor

mikeyc7m commented Oct 4, 2018

Affected Version

SS4.2.0

Description

A DataObject has implemented a validate() function that returns a ValidationResult object. Using the Import CSV button, data can be imported - but if any item fails validation, the import seems to be abandoned without explanation. Furthermore if there were any messages from previous imports (ie. items were previously updated or created) these messages persist, creating the illusion that something happened.

Steps to Reproduce

  1. add validation to a dataobject.
  2. go to modeladmin and click the "import CSV" button.
  3. select a CSV file that you know will have some valid entries, and click the "import from csv" button.
  4. now select a CSV file that you know will have some invalid entries, and click the "import from csv" button.
  5. be confused by the results.

It would be nice if imports succeeded and just skipped the invalids, or alternatively some feedback is given explaining that the import failed.

@mr-macedawg
Copy link
Contributor

Just wanting to follow up on this issue. I can confirm this issue is occurring in SilverStripe 4.11.0.

It is very time consuming trying to find what row in the CSV is causing the issue. No information is recorded in any log which makes it that much more annoying.

@IsaacInsoll
Copy link
Contributor

Yep, I still experience this behaviour as well :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants