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

2.12.2 autowiring of Imagine\Image\ImagineInterface broken #1574

Open
perice opened this issue Mar 2, 2024 · 2 comments
Open

2.12.2 autowiring of Imagine\Image\ImagineInterface broken #1574

perice opened this issue Mar 2, 2024 · 2 comments

Comments

@perice
Copy link

perice commented Mar 2, 2024

When upgrading from 2.12.1 to 2.12.2, I get this error message:

Cannot autowire service "App\Imagine\Filter\Loader\AffineClamp2Filter": argument "$imagine" of method "__construct()" references interface "Imagine\Image\ImagineInterface" but no such service exists. You should maybe alias this interface to one of these existing services: "liip_imagine.gd", "liip_imagine.imagick", "liip_imagine.gmagick".

Sample code:

namespace App\Imagine\Filter\Loader;

use Imagine\Image\ImagineInterface;
use Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface;

class AffineClamp2Filter implements LoaderInterface
{
    /**
     * @var ImagineInterface
     */
    protected $imagine;

    public function __construct(ImagineInterface $imagine)
    {
        $this->imagine = $imagine;
    }
}

Workaround:
Downgrade to 2.12.1

@dbu
Copy link
Member

dbu commented May 16, 2024

i think the issue comes from #1561 where we tell symfony to auto-tag the interface. is your class configured as a service or was it before unused?

that change evaded the changelog, and i should have tagged a new minor version and not a patch version.

however, we should alias the ImagineInterface as a service anyways to help with autowiring, i will look into that now.

@dbu
Copy link
Member

dbu commented May 16, 2024

does #1583 solve the issue for you?

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

2 participants