Steps to reproduce
1: Installed the module using Composer with the command: composer require 'drupal/media_download_tracker:^1.0@beta'.
2: When i tried to enabling this module it throws an error, the error mentioned below.
TypeError: Drupal\media_download_tracker\EventSubscriber\MediaDownloadTrackerSubscriber::__construct(): Argument #2 ($time) must be of type Drupal\Core\Datetime\TimeInterface, Drupal\Component\Datetime\Time given, called in \web\core\lib\Drupal\Component\DependencyInjection\Container.php on line 259 in Drupal\media_download_tracker\EventSubscriber\MediaDownloadTrackerSubscriber->__construct() (line 48 of modules\contrib\media_download_tracker\src\EventSubscriber\MediaDownloadTrackerSubscriber.php).
I've attached an image illustrating my actions—installing the module and searching within the extend panel.
| Comment | File | Size | Author |
|---|---|---|---|
| media download tracker.png | 78.57 KB | aman_lnwebworks |
Issue fork media_download_tracker-3455381
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 #3
aman_lnwebworks commentedHi @imclean
I have created MR!1 for the above issue, please review it once.
Thank you !!
Comment #4
aman_lnwebworks commentedComment #5
imclean commentedThanks for the report. There's an unrelated change, but still valid, which should go in another issue:
That said, although I can replicate the problem, I'm not sure why it's happening.
Drupal\Component\Datetime\TimeInterfaceis what we want, and@datetime.timeis in theservices.yml, which is also correct. See: https://api.drupal.org/api/drupal/core%21core.services.yml/service/Drupa...Comment #6
imclean commentedOK I see the problem now. However the interface should be injected instead.
Drupal\Component\Datetime\TimeInterfaceNW for the above and the unrelated change mentioned in #5.
Comment #7
imclean commentedAs these are preventing the module from being used I've made a quick change to the MR and will merge it. Thanks.
Comment #8
imclean commentedComment #9
imclean commentedComment #11
imclean commented