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

InteractsWithMedia::getFirstMedia enforce $filters as array #1779

Closed
vdauchy opened this issue Mar 16, 2020 · 2 comments
Closed

InteractsWithMedia::getFirstMedia enforce $filters as array #1779

vdauchy opened this issue Mar 16, 2020 · 2 comments

Comments

@vdauchy
Copy link
Contributor

vdauchy commented Mar 16, 2020

Hi,
I suppose this is a small bug as in InteractsWithMedia::class the function:

public function getFirstMedia(string $collectionName = 'default', array $filters = []): ?Media
    {
        $media = $this->getMedia($collectionName, $filters);

        return $media->first();
    }

enforce $filters type to array while InteractsWithMedia::getMedia() supports $filters as callable too.

Have a great day.

@freekmurze
Copy link
Member

I'd accept a PR with tests that fixes this.

@freekmurze
Copy link
Member

Fixed by #1781.

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

2 participants