Problem/Motivation

On Drupal 10 (with the patch from #3296802: Automated Drupal 10 compatibility fixes for now), we get this error when browsing to :

Cannot autowire service "": argument "$config" of method "Drupal\cmis\Controller\CmisRepositoryController::_construct()", you should configure its value explicitly.

This seems to happen because CmisRepositoryController::_construct() has arguments but controller constructor arguments are used for dependency injection so Drupal tries to guess what services need to be passed to the constructor.

It seems weird that the CmisRepositoryController is used both as a controller class for routing and more like a service in some parts of the code like CmisFieldBrowserBuilder::build():

    $browser = new CmisRepositoryController($config_id, $folder_id, ['show_breadcrumb' => $show_breadcrumb]);

    return $browser->browse($config_id, $folder_id);

Steps to reproduce

Browse to /cmis/browser/foo.

Proposed resolution

The constructor should be reserved for dependency injection and what it currently does should be moved to a new method (CmisRepositoryController::fromConfig() for example).

Issue fork cmis-3426572

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

prudloff created an issue. See original summary.

prudloff’s picture

Status: Active » Needs review