The website encountered an unexpected error

Created on 12 July 2022, about 2 years ago
Updated 1 August 2024, about 2 months ago

Problem/Motivation

After installing the module on Drupal 9(composer) and its activation I have not found
a field like "File system path for HMAC protected files" on "Administration ยป Configuration ยป Media ยป File system" page. Also when trying to access configure page "admin/config/media/protected-download" I got "The website encountered an unexpected error. Please try again later." Then I just looked into "protected_download.routing.yml" and saw the route "admin/config/media/protected-download" but did not find the object "\Drupal\protected_download\Form\ProtectedDownloadAdmin" which it linked to in the whole the module code. I believe that one or more files somehow just are not absent in the downloading source. Please fix it if possible.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ท๐Ÿ‡บRussia petrowsb

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Same problem. Still missing... ._. :(

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update over 1 year ago
    1 pass
  • ๐Ÿ‡ง๐Ÿ‡ทBrazil elber Brazil

    I faced the same error it is happening because the class not exists
    Module doesn't have a form to this class.

    I removed the route, no makes sense it there without an existent class

  • Status changed to Fixed over 1 year ago
  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland znerol

    Thanks @elber.

  • sure this is a fix? didn't should be a cofigure form ?
    I'm not sure but I think the route was good, but is missing the file with the class.. I don't know.
    Sorry if I'm wrong, but I still can't use it after removed the route, I cannot find any configuration, any HMAC path...

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland znerol

    sure this is a fix? didn't should be a cofigure form ?

    That's a different issue. If somebody has the bandwidth to port the missing bits from D7, then please go ahead (and open a new issue for that).

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

  • Status changed to Fixed about 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly MXT Milan

    Sorry I'm not sure I understood correctly: can this module be used on D10 without an administration page or is it mandatory for it to work?

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland znerol

    This module is used in production on D10 sites.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly MXT Milan

    Can the HMAC path be setted in settings.php for example?

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly MXT Milan

    I suppose it could be something like this:

    $settings['protected_download_file_path_protected'] = '/my/hmac/filesystem/path';

    (to be placed in settings.php)

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly MXT Milan

    Yes it seems that above settings works: images are saved withing protected-files folder, and these are rendered in the node I attached them with this html:

    <img loading="lazy" src="/protected-download/protected/66b55c00/w9-l6MXrPA8jWOS6UE8ZOgPGwiwqZaunaCOSGAjjfo0/2024-08/my-image.jpg" width="4000" height="3000" alt="alt-text">

    And these are not rendered in the node itself (and also in its edit admin ui) because such src triggers a 404 error.

    Now I'm trying to understand HOW I can generate a working url to such images to be used in an email...

    Do you have any suggestion?

Production build 0.71.5 2024