Fresh install of D9 and can't get it to work, get WSOD when I head to the block/node settings.

I am on D9

ArgumentCountError: Too few arguments to function Drupal\Core\Config\Entity\ConfigEntityStorage::__construct(), 4 passed in /home/feafccef/public_html/live/maerl.studio/modules/fieldblock/src/BlockEntityStorage.php on line 64 and exactly 5 expected in Drupal\Core\Config\Entity\ConfigEntityStorage->__construct() (line 111 of /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php)
#0 /home/feafccef/public_html/live/maerl.studio/modules/fieldblock/src/BlockEntityStorage.php(64): Drupal\Core\Config\Entity\ConfigEntityStorage->__construct(Object(Drupal\Core\Config\Entity\ConfigEntityType), Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\Component\Uuid\Php), Object(Drupal\Core\Language\LanguageManager))
#1 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Component/DependencyInjection/Container.php(257): Drupal\fieldblock\BlockEntityStorage->__construct(Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\Component\Uuid\Php), Object(Drupal\Core\Language\LanguageManager), Object(Drupal\Core\Entity\EntityTypeManager))
#2 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'fieldblock.bloc...')
#3 /home/feafccef/public_html/live/maerl.studio/modules/fieldblock/src/Form/FieldBlockConfigForm.php(86): Drupal\Component\DependencyInjection\Container->get('fieldblock.bloc...')
#4 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php(28): Drupal\fieldblock\Form\FieldBlockConfigForm::create(Object(Drupal\Core\DependencyInjection\Container))
#5 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/Controller/HtmlFormController.php(48): Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\\Drupal\\fieldbl...')
#6 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/Controller/FormController.php(58): Drupal\Core\Controller\HtmlFormController->getFormObject(Object(Drupal\Core\Routing\RouteMatch), '\\Drupal\\fieldbl...')
#7 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#8 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#9 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#10 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#11 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#12 /home/feafccef/public_html/live/maerl.studio/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /home/feafccef/public_html/live/maerl.studio/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#14 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /home/feafccef/public_html/live/maerl.studio/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /home/feafccef/public_html/live/maerl.studio/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /home/feafccef/public_html/live/maerl.studio/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /home/feafccef/public_html/live/maerl.studio/core/lib/Drupal/Core/DrupalKernel.php(705): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /home/feafccef/public_html/live/maerl.studio/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#23 {main}

Comments

effortDee created an issue. See original summary.

cosmin-hm’s picture

I have the same problem, on Drupal 9 (9.0.3).

imclean’s picture

Status: Active » Needs review
StatusFileSize
new2.1 KB

An extra parameter was added in D9. This includes it, but it may cause problems with D8 sites.

michèle’s picture

Patch #3 works well with Drupal 9.1.2.
Thank you, @imclean!

jon@s’s picture

Can confirm it also works on 9.0. Probably needs someone to double check it on an 8.x branch.

rosk0’s picture

Status: Needs review » Reviewed & tested by the community

Tested on D9.1.9 and 2.0.0-alpha5 - works like a charm!

Thank you

sutharsan’s picture

Status: Reviewed & tested by the community » Needs work

This change limits the compatibility of the module to 8.6+. For reference, this is the change record that introduced the constructor change: https://www.drupal.org/node/2973262

Either we add a minimum version requirement to the module's .info file (- drupal:block (>=8.6.0)) or drop the core: 8.x which makes is 8.7+ compatible.

imclean’s picture

Given that security coverage for 8.6 ended in December 2019, I think it's safe to not support it any more.

imclean’s picture

Status: Needs work » Needs review
StatusFileSize
new2.5 KB

Drupal 8 has reached its end of life. To address #7 we can simply support Drupal 9.

rj’s picture

Patch from #9 tested against Drupal 9.3.5, works fine. Thanks!

luongosb’s picture

Patch from #9 works in Drupal 9.3.6 for me as well. Thanks!

lolcode’s picture

Status: Needs review » Reviewed & tested by the community

This patch works well. Thanks! I think it it safe to mark it RTBC.

sutharsan’s picture

StatusFileSize
new2.5 KB

I agree with @imclean that the end of life of Drupal 8 makes it less important to keep full backwards compatibility. But there is no technical necessity to limit it further than 8.7+. This patch adjusts the info.yml accordingly.

  • Sutharsan committed abcf1ae on 8.x-2.x
    Issue #3164381 by imclean, Sutharsan: Can't access block node settings
    
sutharsan’s picture

Status: Reviewed & tested by the community » Fixed

Thanks to all for your contribution.

jasonaaronwood’s picture

Will this patch be applied to a new release at some point?

Status: Fixed » Closed (fixed)

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

amanire’s picture

Not sure if this merits a new issue. On 9.3.19, I see the following error after applying the patch in #13:

Drupal\Core\Extension\InfoParserException: The 'core_version_requirement' can not be used to specify compatibility for a specific version before 8.7.7 in modules/contrib/fieldblock/fieldblock.info.yml in Drupal\Core\Extension\InfoParserDynamic->parse() (line 96 of core/lib/Drupal/Core/Extension/InfoParserDynamic.php).

The error disappears if I change these lines in fieldblock.info.yml from:

core: 8.x
core_version_requirement: ^8.7 | ^9

to:

core_version_requirement: ^8.7.7 | ^9

See https://www.drupal.org/node/3070687

The core: key must not be used here to make sure that versions of Drupal before 8.7.7 will not install the module. Adding both core and core_version_requirement with anything other than core_version_requirement: ^8 || ^9 will result in an exception.

The core_version_requirement cannot be used to restrict to core version before 8.7.7. For instance, core_version_requirement: ^8.7 || ^9 would throw a parsing exception: This is not valid because ^8.7 would include versions like 8.7.0 which do not recognize the core_version_requirement: key.

amanire’s picture

StatusFileSize
new420 bytes

Here is a patch with the changes from the previous comment.

igork96’s picture

Please push the changes from the patch before closing the issue.

piridium’s picture

Patch #9 works for me on core 9.4.8
Thank you!

imclean’s picture

Thanks @amanire. This issue is closed, can you post your patch on the related issue?

amanire’s picture