After updating from Download File version 7.x.1.1 to 7.x.2.1 I receive the following error when I try to download files from my site

Recoverable fatal error: Argument 1 passed to download_file_direct_download() must be an instance of stdClass, string given in download_file_direct_download() (line 145 of /path/to/my/website/sites/all/modules/contrib/download_file/download_file.module).

I am running this on Drupal 7.54.

Please let me know if you need any further information.

Thanks.

Comments

sgtsaughter created an issue. See original summary.

bnjmnm’s picture

Let me know
- the exact URL of the file you're attempting to download
- the formatter used to display the download_file field
- if this is being rendered via a node page template, view, or something else.

sgtsaughter’s picture

  • The URL is mywebsite.com/download/file/fid/384
  • This is being rendered via panels page. The download link is its own pane. When I go to add a pane to the page I select "Node" then select "Field: Lesson File (field_lesson_file)" Lesson file is the name of my download field.
  • The formatter is called "Direct Download File"
bnjmnm’s picture

Apologies in advance for additional questions, but this should get us closer. I'd like to replicate your scenario as closely as possible so I can provide you with a fix.

  • - Let me know the versions of the various panels modules being used on the page
  • - if you have DB access, let me know the output of
    SELECT * FROM file_managed WHERE fid=384;
    
  • - If you're comfortable sharing, please let me know the URL of the site where this issue is occurring and where you have public:// mapped to , This will allow me to access the file on your site directly and analyze the headers . Obviously, If this file has sensitive information I'll get by without
oliverpolden’s picture

A cache clear fixed this for me.

astonvictor’s picture

Status: Active » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.