Getting error searching for ModuleHandlerInterface

Created on 17 August 2023, over 1 year ago
Updated 4 September 2023, over 1 year ago

Problem/Motivation

Just upgraded to version 5 and I'm getting this error when I try to go to https://site/admin/configuration

TypeError: Drupal\photoswipe\PhotoswipeAssetsManager::__construct(): Argument #2 ($module_handler) must be of type Drupal\Core\Extension\ModuleHandlerInterface, Drupal\Core\Render\Renderer given, called in /var/www/html/mo2/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\photoswipe\PhotoswipeAssetsManager->__construct() (line 60 of modules/contrib/photoswipe/src/PhotoswipeAssetsManager.php).
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 197)
Drupal::service() (Line: 26)
photoswipe_requirements()
call_user_func_array() (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 109)
Drupal\system\SystemManager->listRequirements() (Line: 93)
Drupal\system\SystemManager->checkRequirements() (Line: 120)
Drupal\system\Controller\SystemController->overview()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Let me know if I can test anything.

πŸ› Bug report
Status

Closed: works as designed

Version

5.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bogdog400

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

Comments & Activities

  • Issue created by @bogdog400
  • Assigned to Grevil
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @Grevil could you please take a look if this can be reproduced or is special?

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡©πŸ‡ͺGermany Grevil

    Please make sure to run both drush updb and drush cr after update and see if the issue still persists. There isn't anything wrong in code, the service arguments simply changed, and the old arguments are still cached.

  • πŸ‡ΊπŸ‡ΈUnited States bogdog400

    Okay. You were correct that I failed to run updb/cr. But I did that and started getting a new error about the caption. (See below.)

    I haven't found instructions about where to place this plugin. Indeed, the plugin's instructions suggest using npm which don't really help here.

    https://github.com/dimsemenov/photoswipe-dynamic-caption-plugin

    Any thoughts? In the same 'libraries/photoswipe/dist/' directory?

    
    The website encountered an unexpected error. Please try again later.
    
    ValueError: Path cannot be empty in file_get_contents() (line 76 of modules/contrib/photoswipe/modules/photoswipe_dynamic_caption/photoswipe_dynamic_caption.install).
    photoswipe_dynamic_caption_requirements()
    call_user_func_array() (Line: 409)
    Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 388)
    Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 416)
    Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 109)
    Drupal\system\SystemManager->listRequirements() (Line: 93)
    Drupal\system\SystemManager->checkRequirements() (Line: 120)
    Drupal\system\Controller\SystemController->overview()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    
    
  • Status changed to Fixed over 1 year ago
  • πŸ‡©πŸ‡ͺGermany Grevil

    Please take a look at the README.md of the submodule: https://git.drupalcode.org/project/photoswipe/-/blob/5.x/modules/photosw...

    There everything is explained. Thanks for pointing out, that this information is indeed missing on the module page! I'll adjust it accordingly!

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States bogdog400

    BTW, I tried to install the plugin using the composer command listed in the docs and I got this error:

    
    composer require "npm-asset/photoswipe-dynamic-caption-plugin:^1.2"
    Do not run Composer as root/super user! See https://getcomposer.org/root for details
    Continue as root/super user [yes]? 
    Info from https://repo.packagist.org: #StandWithUkraine
    ./composer.json has been updated
    Running composer update npm-asset/photoswipe-dynamic-caption-plugin
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Root composer.json requires npm-asset/photoswipe-dynamic-caption-plugin, it could not be found in any version, there may be a typo in the package name.
    
    Potential causes:
     - A typo in the package name
     - The package is not available in a stable-enough version according to your minimum-stability setting
       see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
     - It's a private package and you forgot to add a custom repository to find it
    
    Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
    
    Installation failed, reverting ./composer.json and ./composer.lock to their original content.
    
    

    The command line was copied from here:

    https://git.drupalcode.org/project/photoswipe/-/blob/5.x/modules/photosw...

  • πŸ‡ΊπŸ‡ΈUnited States bogdog400

    But cloning it directly worked fine:

    git clone https://github.com/dimsemenov/photoswipe-dynamic-caption-plugin.git

    Thanks!

  • πŸ‡©πŸ‡ͺGermany Grevil

    Hey @bogdog400!
    You need to activate the use of third party libraries for composer!

    Enable usage of third-party libraries using composer, see here for an explanation.

    https://www.drupal.org/docs/develop/using-composer/using-composer-to-ins... β†’ .

  • πŸ‡ΊπŸ‡ΈUnited States bogdog400

    Thx!

Production build 0.71.5 2024