Problem/Motivation
After updating from 8.x-1.0-beta8 to 8.x-1.0-rc1, the following fatal error occurs when saving a file entity:
Error: Call to a member function isEmpty() on array in
Drupal\filefield_paths\Hook\File->filePresave()
(line 43 of /app/web/modules/contrib/filefield_paths/src/Hook/File.php).
Steps to reproduce
- Have a working Drupal site with filefield_paths 8.x-1.0-beta8
- Update to 8.x-1.0-rc1
- Run drush updb but without running drush cr
- Trigger a file save — fatal error occurs
Proposed resolution
Guard against $file->origname being an array before calling ->isEmpty() on it.
Comments