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.

CommentFileSizeAuthor
media download tracker.png78.57 KBaman_lnwebworks
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

aman_lnwebworks created an issue. See original summary.

aman_lnwebworks’s picture

Assigned: aman_lnwebworks » Unassigned

Hi @imclean

I have created MR!1 for the above issue, please review it once.

Thank you !!

aman_lnwebworks’s picture

Title: Issue with module installing » Issue with module installation
imclean’s picture

Thanks for the report. There's an unrelated change, but still valid, which should go in another issue:

- use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+ use Symfony\Component\HttpKernel\Event\RequestEvent;

That said, although I can replicate the problem, I'm not sure why it's happening. Drupal\Component\Datetime\TimeInterface is what we want, and @datetime.time is in the services.yml, which is also correct. See: https://api.drupal.org/api/drupal/core%21core.services.yml/service/Drupa...

imclean’s picture

Version: 1.0.0-beta1 » 1.0.x-dev
Status: Active » Needs work

OK I see the problem now. However the interface should be injected instead. Drupal\Component\Datetime\TimeInterface

NW for the above and the unrelated change mentioned in #5.

imclean’s picture

Title: Issue with module installation » Issue with module installation - incorrect class names

As these are preventing the module from being used I've made a quick change to the MR and will merge it. Thanks.

imclean’s picture

Status: Needs work » Fixed
imclean’s picture

imclean’s picture

Status: Fixed » Closed (fixed)