- Issue created by @Tamerap
- Assigned to abhishek_virasat
- Assigned to Shreya_98
- @shreya_th opened merge request.
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 9:55am 27 October 2023
This error pops up when you visit the download-view/view page.
The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\media\Entity\Media::getFileUri() in Drupal\vfd\Controller\DownloadViewController->download() (line 120 of modules/contrib/vfd/src/Controller/DownloadViewController.php).
Caused by referencing file content using a media field type. In the code, it only checks if the the field type is either media or file, but if you try to download files that are referenced by medias, it'll throw this error.
Ad a statement within DownloadViewController.php after line 101 that will check if $node is a file entity and add a statement that will include it.
Received a warning error that mkdir($dir) in Downloadviewcontroller.php already exits. Maybe add an if state to check if the file already exists and what to do if it does
Needs review
2.0
Code