Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Seeing this error: array_merge(): Argument #1 is not an array filefield_meta.module:78
Here's the diff:
@@ -73,7 +73,7 @@
* Implementation of FileField's hook_file_insert().
*/
function filefield_meta_file_insert(&$file) {
- if (!empty($file->fid)) {
+ if (!empty($file->fid) && is_array($file->data)) {
filefield_meta($file);
$record = array_merge($file->data, array('fid' => $file->fid));
drupal_write_record('filefield_meta', $record);
Comments
Comment #0.0
djbobbydrake CreditAttribution: djbobbydrake commentedformatting
Comment #1
rgristroph CreditAttribution: rgristroph commentedI tested this patch, and confirmed that the warning exists without it and went away with it.
--Rob
Comment #2
quicksketchThanks, I fixed this with a similar approach in #1809872: Error message with FileField Meta/Filedepot.
Comment #3.0
(not verified) CreditAttribution: commentedformatting