There is a possibility that file copy is not required and the meta information need to be stored in
the file-manged table, but current file_save is strict that if physically file doesn't exists then
meta information of files will not be saved in file-managed. One of the prime example to migrate files from amazon s3 bucket
generally high volume physical files are soft link with drupal files(e.g. sites/default/files), so there is possibility that physically all the files are not available or deleted but in legacy db that information is available, so this little patch can overcome the problem can continue to store the file information in file-manage
Comment | File | Size | Author |
---|---|---|---|
#3 | 2886138-check-with-filesize-3.patch | 703 bytes | roynilanjan |
Comments
Comment #2
roynilanjan CreditAttribution: roynilanjan commentedComment #3
roynilanjan CreditAttribution: roynilanjan commentedComment #4
roynilanjan CreditAttribution: roynilanjan commentedComment #5
Parashram CreditAttribution: Parashram commentedYes, It's working fine..
Comment #6
Parashram CreditAttribution: Parashram commentedComment #7
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commented#3 patch looks good to me. +1 to RTBC
Comment #8
stefan.r CreditAttribution: stefan.r commentedHave we looked at 8.x (per the backport policy)?
Drupal\file\Entity::preSave()
seems to have a similar snippet.Comment #9
Parashram CreditAttribution: Parashram at ]init[ AG commented