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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

roynilanjan created an issue. See original summary.

roynilanjan’s picture

Title: file_save should have a check on file_size » file_save should have a check on filesize
roynilanjan’s picture

roynilanjan’s picture

Status: Active » Needs review
Parashram’s picture

Status: Needs review » Fixed

Yes, It's working fine..

Parashram’s picture

Status: Fixed » Reviewed & tested by the community
Dinesh18’s picture

#3 patch looks good to me. +1 to RTBC

stefan.r’s picture

Status: Reviewed & tested by the community » Needs review

Have we looked at 8.x (per the backport policy)? Drupal\file\Entity::preSave() seems to have a similar snippet.

Parashram’s picture