Network error on download

Created on 6 June 2023, over 1 year ago
Updated 28 December 2023, about 1 year ago

Problem/Motivation

Error is the same as the one described here : https://www.drupal.org/project/backup_migrate/issues/3228379 🐛 Download errors, backup files contain trailing HTML, corrupts archive backups Needs work
Can't access private directory (license files and files on product/file admin pages) : Failed network - error (on Chrome, Firefox, Safari etc.)

Warning: Undefined array key "commerce_file_target_id" in Drupal\commerce_file\Plugin\views\field\DownloadLimit->render() (line 92 of modules/contrib/commerce_file/src/Plugin/views/field/DownloadLimit.php).

Steps to reproduce

Commerce + Commerce File + Commerce license
+ File (Field) Paths
May be a messy situation with pfdp module ? https://www.drupal.org/project/private_files_download_permission
(When pfdp is active, admin can access file products. Users can't access granted licensed files)

Proposed resolution

Patch https://www.drupal.org/project/backup_migrate/issues/3228379#comment-143... 🐛 Download errors, backup files contain trailing HTML, corrupts archive backups Needs work
worked fine for backup migrate files

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇫🇷France laurentwh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @laurentwh
  • 🇫🇷France laurentwh

    Works fine on PHP 8.19 - Not on 8.0.28

  • 🇹🇭Thailand Nick Hope

    On successful checkout (at /checkout/1/complete) I'm seeing the same warning:

    Warning: Undefined array key "commerce_file_target_id" in Drupal\commerce_file\Plugin\views\field\DownloadLimit->render() (line 92 of /var/www/html/web/modules/contrib/commerce_file/src/Plugin/views/field/DownloadLimit.php)

    However I'm not seeing any network error and can download the file.

    I have a local development site in Drupal 10.2.0 / Commerce 8.x-2.36 / Commerce File 8.x-2.1 / PHP 8.3.0.

    Document root is /web and I have my file for download in /private.

    At /admin/commerce/config/license/file I have the global download limit set to 10. I left the 'Limit...' box unchecked for my product.

    The "Downloads" column is empty (as it is in Matt Glaman's demonstration video). That might provide a clue.

Production build 0.71.5 2024