- First commit to issue fork.
- Status changed to RTBC
over 1 year ago 5:46pm 30 March 2023
The TabTypeManager specifies the DefaultFactory to use, which ironically is not the default. DefaultFactory means that a plugin cannot use ContainerFactoryPluginInterface to inject its dependencies. It is a best practice to use dependency injection rather than the global \Drupal object.
1. Implement a TabType class that implements ContainerFactoryPluginInterface and injects another dependency.
2. Try to instantiate a QuickTabsInstance with a tab using that tab type.
3. An exception will be thrown because TabTypeManager will try to create the plugin instance with default arguments.
Remove the line in TabTypemanager, $this->factory = new DefaultFactory($this->getDiscovery());<code>. This will let DefaultPluginManager use the default factory, which is <code>ContainerFactory
1. Create an issue fork and merge request with the line removed.
2. Optionally fix one of the tab types to inject dependencies instead.
3. See if tests pass.
No
It becomes possible to inject dependencies rather than use global Drupal object.
No
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.