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.
Problem/Motivation
This error is being presented in the browser console that does not allow downloading files. This says Google Chrome: https://blog.chromium.org/2020/02/protecting-users-from-insecure.html
This issue is reported in the module views_data_export
too.
https://www.drupal.org/project/views_data_export/issues/3189135
Steps to reproduce
Files cannot be downloaded in chrome in some urls.
Proposed resolution
Create a patch.
Comment | File | Size | Author |
---|---|---|---|
#5 | 3221760-5.patch | 1.04 KB | jsacksick |
| |||
#2 | cannot-download-files-3221760-1-D8.patch | 1.02 KB | dmezquia |
| |||
error-console.png | 164.92 KB | dmezquia |
Issue fork vbo_export-3221760
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
Comment #2
dmezquiaComment #3
dmezquiaThe patch #2 get relative url to prevent mixed content errors when using HTTPS + HTTP.
Comment #4
interdruper CreditAttribution: interdruper at Interdruper commentedPatch #2 works for me.
Comment #5
jsacksick CreditAttribution: jsacksick at Centarro commentedSame patch, with a target blank added to the link as the download doesn't trigger for me.
Comment #6
Graber CreditAttribution: Graber as a volunteer commentedCool it works but.. Can't we get the same string using the Link class? Whenever there's API available, it should be used, maybe it's just a case of adding some parameters to the generating method?
Comment #7
dmezquia@Graber I see no problem using the
file_url_transform_relative()
andfile_create_url()
methods, they are not marked as decrepted and they are also used in many places in the core.Comment #8
dmezquiaComment #9
dmezquiaHi @Graber, any update on this issue? do you plan to release another release?
I have had to be applying this patch in all the projects where I use it, I use this module a lot.
Comment #10
Graber CreditAttribution: Graber as a volunteer commentedSorry, I'm totally busy with other things currently and barely find time for VBO. Will handle this tomorrow.
Comment #11
dmezquiaThank you @Graber
Comment #13
Graber CreditAttribution: Graber as a volunteer commentedComment #14
Graber CreditAttribution: Graber as a volunteer commentedAdditional use statement cleanup was also needed.