- Issue created by @prudloff
- Merge request !19Issue #3426572: Error when loading CmisRepositoryController → (Open) created by prudloff
- Status changed to Needs review
over 1 year ago 9:27am 8 March 2024
On Drupal 10 (with the patch from 📌 Automated Drupal 10 compatibility fixes Needs review 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);
Browse to /cmis/browser/foo
.
The constructor should be reserved for dependency injection and what it currently does should be moved to a new method (CmisRepositoryController::fromConfig()
for example).
Needs review
Code