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]: Sheets method called twice #3910

Closed
1 task done
vinod-digitalcubez opened this issue Apr 8, 2023 · 1 comment
Closed
1 task done

[Bug]: Sheets method called twice #3910

vinod-digitalcubez opened this issue Apr 8, 2023 · 1 comment
Labels

Comments

@vinod-digitalcubez
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

What version of Laravel are you using?

9.52

What version of PHP are you using?

8.1.0

Describe your issue

the Sheet method is called multiple times. and are repeatedly making duplications during the import of multiple sheets.

How can the issue be reproduced?

class StudentImport implements WithMultipleSheets
{

public function sheets(): array
{
    return [
       'Student' => new StudentSheet(),
        'Fees' => new FeesSheet(),
   
    ];
}

}
and here is student sheet

class CustomerSheet implements ToCollection
{
public function collection(Collection $row)
{

 return newStudent(
        [
            'first_name'           =>   $row['first_name']           ?? null,
            'middle_name'          =>   $row['middle_name']          ?? null,
            'last_name'            =>   $row['last_name']            ?? null
    ])

}

What should be the expected behaviour?

Sheet method do not call multiple time as same sheet are getting duplicate.

@patrickbrouwers
Copy link
Member

Duplicate of #3891

@patrickbrouwers patrickbrouwers closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2023
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

2 participants