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

[Bug]: WithChunkReading throws exception on unknown sheets #4281

Open
1 task done
pusherman opened this issue Mar 20, 2025 · 0 comments
Open
1 task done

[Bug]: WithChunkReading throws exception on unknown sheets #4281

pusherman opened this issue Mar 20, 2025 · 0 comments
Labels

Comments

@pusherman
Copy link

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

  • Yes, it's still reproducable

What version of Laravel Excel are you using?

3.1.64

What version of Laravel are you using?

12.1.1

What version of PHP are you using?

8.3.6

Describe your issue

When importing with multiple sheets and using WithChunkReading, an exception will be thrown and reading skipped if an unknown sheet is encountered even when SkipsUnknownSheets is set.

How can the issue be reproduced?

Create a spreadsheet with only 2 tabs (People and Places) and import using a similar class

class TestImport implements WithMultipleSheets, SkipsUnknownSheets, WithBatchInserts, WithChunkReading
{
    public function sheets(): array
    {
        return [
            'People' => new PeopleImport(),
            'Places' => new PlacesImport()
            'Things' => new ThingsImport(),
        ];
    }

    public function onUnknownSheet($sheetName): void
    {
        info("Sheet $sheetName was skipped on import");
    }
}

What should be the expected behaviour?

The import should work as expected

@pusherman pusherman added the bug label Mar 20, 2025
pusherman added a commit to pusherman/Laravel-Excel that referenced this issue Mar 20, 2025
@pusherman pusherman changed the title [Bug]: WithChunkReading throws exception of unknown sheets [Bug]: WithChunkReading throws exception on unknown sheets Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant