While working on https://www.drupal.org/project/feeds/issues/3042774 , I observed that there is a piece of code in file : FeedsEnclosure.php at line : 125
else {
// If file is not to be copied, check whether file already exists,
// as file_save() won't do that for us (compare file_copy() and
// file_save())
$existing_files = file_load_multiple([], ['uri' => $file->getFileUri()]);
if ($existing_files) {
return reset($existing_files);
}
$file->save();
}
According to which we are trying to get file ids using file URI , but if we see the file_load_multiple definition it says:
function file_load_multiple(array $fids = NULL, $reset = FALSE) {
@trigger_error('file_load_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\file\Entity\File::loadMultiple(). See https://www.drupal.org/node/2266845', E_USER_DEPRECATED);
if ($reset) {
\Drupal::entityManager()->getStorage('file')->resetCache($fids);
}
return File::loadMultiple($fids);
}
So according to the code we only have two arguments accepted by file_load_multiple i.e $fid of type array and $reset of type boolean. But while calling we are sending second argument as array , which will throw a error and will not work.
Comments
Comment #2
yogen.prasad commentedComment #3
yogen.prasad commentedComment #4
megachrizIt seems that FeedsEnclosure isn't used anywhere in the Feeds code. Looks like dead code. Perhaps the class should be removed completely.
Comment #5
megachrizLet's see what happens if I just remove the class.
Comment #7
megachrizNo test failures. Okay, let's just remove the class and wait for any angry users. 😈