You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I was going to implement the solution to be able to update Files in an Entity (#8 (comment)), I noticed an Error when I handle my update Form :
Catchable Fatal Error: Argument 1 passed to VENDOR\Bundle\Entity\MyEntity::setImage() must be an instance of Symfony\Component\HttpFoundation\File\File, null given
To fix that I can change that :
public function setImage(File $image)
{
$this->image = $image;
return $this;
}
to that :
public function setImageTexte($image)
{
$this->image = $image;
return $this;
}
But I guess if that's the solution it would be in the documentation, did I do something wrong ?
By the way, here are my properties :
/**
* @Vich\UploadableField(mapping="article_image", fileNameProperty="imagePath")
*
* Note : This is not a mapped field of entity metadata, just a simple property.
*
* @var File $image
*
* @Assert\File(maxSize="6000000", mimeTypes={"image/jpeg", "image/png"})
*/
public $image;
/**
* @var string
*
* @ORM\Column(name="image_path", type="string", length=45)
*/
private $imagePath;
The text was updated successfully, but these errors were encountered:
While I was going to implement the solution to be able to update Files in an Entity (#8 (comment)), I noticed an Error when I handle my update Form :
To fix that I can change that :
to that :
But I guess if that's the solution it would be in the documentation, did I do something wrong ?
By the way, here are my properties :
The text was updated successfully, but these errors were encountered: