Problem/Motivation

Installed all current config_distro dependencies, when going to admin/config/development/configuration/distro, WSOD.

ArgumentCountError: Too few arguments to function Drupal\config_normalizer\Config\NormalizedReadOnlyStorage::__construct(), 1 passed in /var/www/html/web/modules/contrib/config_filter/src/Config/ReadOnlyStorage.php on line 108 and at least 2 expected in Drupal\config_normalizer\Config\NormalizedReadOnlyStorage->__construct() (line 40 of /var/www/html/web/modules/contrib/config_normalizer/src/Config/NormalizedReadOnlyStorage.php).
#0 /var/www/html/web/modules/contrib/config_filter/src/Config/ReadOnlyStorage.php(108): Drupal\config_normalizer\Config\NormalizedReadOnlyStorage->__construct(Object(Drupal\config_provider\InMemoryStorage))
#1 /var/www/html/web/modules/contrib/config_sync/src/Plugin/ConfigFilter/SyncFilter.php(270): Drupal\config_filter\Config\ReadOnlyStorage->createCollection('language.ar')
#2 /var/www/html/web/modules/contrib/config_filter/src/Config/FilteredStorage.php(210): Drupal\config_sync\Plugin\ConfigFilter\SyncFilter->filterCreateCollection('language.ar')
#3 /var/www/html/web/core/lib/Drupal/Core/Config/CachedStorage.php(238): Drupal\config_filter\Config\FilteredStorage->createCollection('language.ar')
#4 /var/www/html/web/core/lib/Drupal/Core/Config/StorageComparer.php(127): Drupal\Core\Config\CachedStorage->createCollection('language.ar')
#5 /var/www/html/web/core/lib/Drupal/Core/Config/StorageComparer.php(402): Drupal\Core\Config\StorageComparer->getSourceStorage('language.ar')
#6 /var/www/html/web/core/lib/Drupal/Core/Config/StorageComparer.php(204): Drupal\Core\Config\StorageComparer->getAndSortConfigData('language.ar')
#7 /var/www/html/web/core/modules/config/src/Form/ConfigSync.php(183): Drupal\Core\Config\StorageComparer->createChangelist()
#8 /var/www/html/web/modules/contrib/config_distro/src/Form/ConfigDistroImportForm.php(43): Drupal\config\Form\ConfigSync->buildForm(Array, Object(Drupal\Core\Form\FormState))
#9 /var/www/html/web/modules/contrib/config_sync/src/Form/ConfigSyncImportForm.php(76): Drupal\config_distro\Form\ConfigDistroImportForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#10 [internal function]: Drupal\config_sync\Form\ConfigSyncImportForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#11 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(514): call_user_func_array(Array, Array)
#12 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(271): Drupal\Core\Form\FormBuilder->retrieveForm('config_distro_i...', Object(Drupal\Core\Form\FormState))
#13 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(74): Drupal\Core\Form\FormBuilder->buildForm('config_distro_i...', Object(Drupal\Core\Form\FormState))
#14 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#15 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#16 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#17 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#18 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#19 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#20 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#21 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(664): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#30 {main}

Offending code:

class ReadOnlyStorage implements StorageInterface {
  public function createCollection($collection) {
    return new static($this->storage->createCollection($collection));
  }
class NormalizedReadOnlyStorage extends ReadOnlyStorage implements NormalizedReadOnlyStorageInterface {
  public function __construct(StorageInterface $storage, ConfigNormalizerManager $normalizer_manager = NULL, array $context = []) {

Proposed resolution

We can argue who has to change now,
* \Drupal\config_normalizer\Config\NormalizedReadOnlyStorage::__construct
* \Drupal\config_filter\Config\ReadOnlyStorage::createCollection

After some thinking i'd say pragmatically, changing in config_normalizer is far more easy.

Comments

axel.rutz created an issue. See original summary.

geek-merlin’s picture

Patch flying in that should fix the issue.

geek-merlin’s picture

Yes, worksforme.

nedjo’s picture

Status: Active » Needs review
StatusFileSize
new1.49 KB

Thanks!

I think we need to implement ::createCollection(). Can you try this?

geek-merlin’s picture

Status: Needs review » Reviewed & tested by the community

Ah of course, that's not a static function so fix is super easy.

Tested the patch and it applies cleanly and solves the issue.

  • nedjo committed 201732a on 8.x-1.x
    Issue #3009347 by axel.rutz, nedjo: WSOD: Too few arguments to function...
nedjo’s picture

Status: Reviewed & tested by the community » Fixed

Thx!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.