diff --git a/Resources/doc/index.md b/Resources/doc/index.md index 022e16ab..908e2d92 100644 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -429,3 +429,37 @@ vich_uploader: store files. The bundle ships with vich_uploader.storage.file_system and vich_uploader.storage.gaufrette see [FileSystemStorage VS GaufretteStorage](#filesystemstorage-vs-gaufrettestorage) + +## Know issues + +### The file is not updated if there are not other changes in the entity +As the bundle is listen on Doctrine event `prePersist` and `preUpdate`, which are not fired +when there is no change on field mapped by Doctrine, the file upload is not handled. + +A workaround to solve this issue is to manually generate a change: + +``` +class Product +{ + // ... + + /** + * @ORM\Column(type="datetime") + * + * @var \DateTime $updatedAt + */ + protected $updatedAt; + + // ... + + public function setImage($image) + { + $this->image = $image; + + if ($this->image) { + $this->updatedAt = new \DateTime('now'); + } + } +} +``` +See issue [GH-123](https://github.com/dustin10/VichUploaderBundle/issues/123)