Laravel-Excel icon indicating copy to clipboard operation
Laravel-Excel copied to clipboard

[Bug]: SkipsOnError doesnt actually skips

Open diego-lipinski-de-castro opened this issue 3 years ago • 3 comments
trafficstars

Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?

  • [X] Yes, it's still reproducable

What version of Laravel Excel are you using?

3.1

What version of Laravel are you using?

9.2

What version of PHP are you using?

8.1.6

Describe your issue

Invalid rows should be skipped, and valid rows should be inserted, instead, nothing gets inserted

config/excel.php is as it comes, nothing changed from default, by reading documentation I dont know if there is something I need to change (altho I tried some modifications but nothing made it work)

Below is the import meaningful code Screen Shot 2022-06-11 at 15 08 09

And the controller method just in case Screen Shot 2022-06-11 at 15 09 01

How can the issue be reproduced?

Try and import an excel with valid and invalid rows, with the SkipsOnFailure + SkipsFailures traits, nothing gets inserted

What should be the expected behaviour?

The rows that fails validation gets skipped, and the other gets inserted

If you believe this is a bug, please provide a failing unit test via a PR

patrickbrouwers avatar Jun 11 '22 18:06 patrickbrouwers

Sure I will, but I need to know if the code is correct before confirming its a bug

Depending what's in the rules and model methods it seems correct. Not sure about the upserts, but should work as well

patrickbrouwers avatar Jun 12 '22 21:06 patrickbrouwers

This bug report has been automatically closed because it has not had recent activity. If this is still an active bug, please comment to reopen. Thank you for your contributions.

stale[bot] avatar Aug 14 '22 08:08 stale[bot]