Problem/Motivation

The module affects normal files download behavior.
When opening Media documents, they download instead of being opened in new window (as it works by default for PDFs).

Steps to reproduce

1. Install Drupal, enable Media module.
2. Create the Media file with PDF.
3. Go to /admin/content/files
4. Click the PDF file link. Observe the PDF being opened in new tab.
5. Install single_content_sync module.
6. Click the same PDF file link.

Expected: the file opens at new tab.
Actual: the file is being downloaded.

Proposed resolution

Update the single_content_sync_file_download function to only affect file download routes added by the module.

CommentFileSizeAuthor
#6 file-downloads-3366216-6.patch1.31 KBfoxy-vikvik
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

Foxy-vikvik created an issue. See original summary.

foxy-vikvik’s picture

Version: 2.0.x-dev » 1.3.x-dev

foxy-vikvik’s picture

StatusFileSize
new1.31 KB

Patch from MR

foxy-vikvik’s picture

foxy-vikvik’s picture

Assigned: foxy-vikvik » Unassigned
Status: Active » Needs review
abramm’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: -Drupal 10
abramm’s picture

Version: 1.3.x-dev » 1.4.x-dev
abramm’s picture

Version: 1.4.x-dev » 1.3.x-dev
abramm’s picture

abramm’s picture

Version: 1.3.x-dev » 1.4.x-dev
Assigned: Unassigned » abramm
Category: Task » Bug report
Status: Needs work » Active

Rebased the MR over 1.4.x.

  • abramm committed 66a93c86 on 1.4.x authored by Foxy-vikvik
    Issue #3366216: Added condition for hook_file_download and it will be...

  • abramm committed f5e33474 on 1.3.x authored by Foxy-vikvik
    Issue #3366216: Added condition for hook_file_download and it will be...
abramm’s picture

Assigned: abramm » Unassigned
Status: Active » Fixed

Merged the fix to 1.4.x and cherry-picked to 1.3.x since it's a bug.

Thank you Foxy-vikvik!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.