There is no extension able to load the configuration for "vich_uploader"

I would like to use vich uploader in my easy admin interface. After installing it, I’ve created the vich_uploader.yaml file (it is not generating alone in my case).
I’ve follow the tutorial in the symfony page, but when I want to use it, an error occured :

"There is no extension able to load the configuration for "vich_uploader""

I really don’t understand why, here is my files :

easy_admin.yaml :

easy_admin:
    entities:
      Project:
        list:
          fields:
            - { property: 'photo_1', type: 'image', base_path: '%app.path.project_images%' }
        show:
          fields:
            - { property: 'photo_1', type: 'image', base_path: '%app.path.project_images%' }
        form:
          fields:
            - {property: 'photo_1File', type: 'vich_image'}

vich_uploader.yaml :

vich_uploader:
  db_driver: orm
  mappings:
    project_images:
      uri_prefix:         '%app.path.project_images%'
      upload_destination: '%kernel.project_dir%/public%app.path.project_images%'

My project entity looks like :

/**
 * @ORMEntity(repositoryClass=ProjectRepository::class)
 * @VichUploadable
 */
class Project
{
/**
     * @ORMColumn(type="string", length=255, nullable=true)
     * @var string
     */
    private $photo_1;

/**
     * @VichUploadableField(mapping="project_images", fileNameProperty="photo_1")
     * @var File
     */
    private $photo_1File;

public function getPhoto1(): ?string
    {
        return $this->photo_1;
    }

public function setPhoto1(?string $photo): self
    {
        $this->photo_1 = $photo;

        return $this;
    }

public function setPhoto1File(File $image = null)
    {
        $this->photo_1File = $image;
        if ($image) {
            $this->updatedAt = new DateTime('now');
        }
    }
public function getPhoto1File()
    {
        return $this->photo_1File;
    }

services.yaml :

parameters:
    app.path.project_images: /uploads/images/projects

I’ve the line "vich/uploader-bundle": "^1.15" in my composer.json. It looks like symfony doesn’t found the package…

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *