Skip to content

EasyAdmin field not showing stored data #50

@markeasting

Description

@markeasting

I've followed the README and created my entity as follows:

    #[ORM\Column(type: 'easy_media_type', nullable: true)]
    private $image = null;
    
    public function getImage()
    {
        return $this->image;
    }

    public function setImage($image): static
    {
        $this->image = $image;

        return $this;
    }

EasyAdmin crud field setup:

EasyMediaField::new('image')->setFormTypeOptions([
    'restrictions_uploadTypes' => ['image/*'],
    'restrictions_uploadSize' => 5.0,
    'editor' => false,
    'upload' => true,
    'bulk_selection' => false,
    'move' => false,
    'rename' => false,
    'metas' => false,
    'delete' => false,
])

Before saving:

Image

After saving, the preview is gone:

Image

However, in the database, it stores the ID as a string:

Image

Project dependencies:

"agence-adeliom/easy-media-bundle": "^3.0",
"symfony/framework-bundle": "6.4.*",
"doctrine/doctrine-bundle": "^2.13",
"easycorp/easyadmin-bundle": "^4.8",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions