Laravel-medialibrary: The Media\Model depends on non-existant function on UrlGenerator interface

Created on 5 Dec 2019  路  3Comments  路  Source: spatie/laravel-medialibrary

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.

Most helpful comment

This has been fixed on the v8 branch.

All 3 comments

same with me

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

This has been fixed on the v8 branch.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mohammad6006 picture mohammad6006  路  4Comments

Nks picture Nks  路  3Comments

stayallive picture stayallive  路  4Comments

xron89 picture xron89  路  3Comments

netanelwebninja picture netanelwebninja  路  3Comments