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

The Media\Model depends on non-existant function on UrlGenerator interface #1656

Closed
drtheuns opened this issue Dec 5, 2019 · 3 comments
Closed

Comments

@drtheuns
Copy link

drtheuns commented Dec 5, 2019

In the Spatie\MediaLibrary\Models\Media class there is the following function:

public function getPath(string $conversionName = ''): string
{
    $urlGenerator = UrlGeneratorFactory::createForMedia($this, $conversionName);

    return $urlGenerator->getPath();
}

The UrlGeneratorFactory::createForMedia returns a type of the UrlGenerator interface, which does not contain the getPath() function.

We had written our own UrlGenerator according to the docs, but when it went live we were seeing errors with the PerformConversions due to this unexpected method call which we hadn't implemented.

@nguyentranchung
Copy link

same with me

@freekmurze
Copy link
Member

Modify the interface now is a breaking change. We'll correct this in the next major version of the package.

@freekmurze
Copy link
Member

This has been fixed on the v8 branch.

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

No branches or pull requests

3 participants