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.

CommentFileSizeAuthor
filefield_paths-fix-isempty-on-array.patch606 bytespmkanse
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pmkanse created an issue.