When tapping "+ Add new block" in the "Content" section of a panelized content type, there is an AJAX/JavaScript error when this plugin is installed. Instead of showing the normal modal window to allow selection ob blocks, nothing happens. Inspecting shows there was an error error:

AjaxError: 
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /admin/structure/panels/panelizer.wizard/node__builders_page__default__builders_page/select_block?region&destination=/admin/structure/panelizer/edit/node__builders_page__default__builders_page/content%3Fjs%3Dnojs
StatusText: OK
ResponseText: 

Occurs using safari, chrome, and explorer.

After uninstalling this module the "+ Add new block" button works as expected.

Drupal logs show the following error which is related:

Location	http://[actual domain]/admin/structure/panels/panelizer.wizard/node__about_common_page__default__about_page/select_block?_wrapper_format=drupal_modal&destination=%2Fadmin%2Fstructure%2Fpanelizer%2Fedit%2Fnode__about_common_page__default__about_page%2Fcontent%3Fjs%3Dnojs&region
Referrer	http://[actual domain]/admin/structure/panelizer/edit/node__about_common_page__default__about_page/content?js=noms

Message:
Recoverable fatal error: Argument 4 passed to Drupal\paragraph_blocks\ParagraphBlocksEntityManager::__construct() must implement interface Drupal\Core\Config\ConfigFactoryInterface, none given, called in /path/to/install/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 276 and defined in Drupal\paragraph_blocks\ParagraphBlocksEntityManager->__construct() (line 49 of /path/to/install/web/modules/contrib/paragraph_blocks/src/ParagraphBlocksEntityManager.php) #0 /path/to/install/web/core/includes/bootstrap.inc(566): _drupal_error_handler_real(4096, 'Argument 4 pass...', '/vol/ebs1/var/w...', 49, Array) #1 /path/to/install/web/modules/contrib/paragraph_blocks/src/ParagraphBlocksEntityManager.php(49): _drupal_error_handler(4096, 'Argument 4 pass...', '/vol/ebs1/var/w...', 49, Array) #2 /path/to/install/web/core/lib/Drupal/Component/DependencyInjection/Container.php(276): Drupal\paragraph_blocks\ParagraphBlocksEntityManager->__construct(Object(Drupal\Core\Path\AliasManager), Object(Drupal\Core\Entity\EntityTypeManager), Object(Symfony\Component\HttpFoundation\RequestStack)) #3 /path/to/install/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'paragraph_block...') #4 /path/to/install/web/core/lib/Drupal.php(158): Drupal\Component\DependencyInjection\Container->get('paragraph_block...') #5 /path/to/install/web/modules/contrib/paragraph_blocks/paragraph_blocks.module(59): Drupal::service('paragraph_block...') #6 /path/to/install/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(501): paragraph_blocks_panels_ipe_blocks_alter(Array, NULL, NULL) #7 /path/to/install/web/modules/contrib/paragraph_blocks/src/Controller/ParagraphBlocksPanelsController.php(48): Drupal\Core\Extension\ModuleHandler->alter('panels_ipe_bloc...', Array) #8 [internal function]: Drupal\paragraph_blocks\Controller\ParagraphBlocksPanelsController->selectBlock(Object(Symfony\Component\HttpFoundation\Request), 'node__about_com...', 'panelizer.wizar...') #9 /path/to/install/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #10 /path/to/install/web/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #11 /path/to/install/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #12 /path/to/install/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #13 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #14 /path/to/install/vendor/symfony/http-kernel/HttpKernel.php(144): call_user_func_array(Object(Closure), Array) #15 /path/to/install/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #16 /path/to/install/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /path/to/install/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /path/to/install/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /path/to/install/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /path/to/install/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /path/to/install/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /path/to/install/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /path/to/install/web/core/lib/Drupal/Core/DrupalKernel.php(656): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /path/to/install/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #25 {main}.

Comments

iamamused created an issue. See original summary.

iamamused’s picture

Title: JavaScript error when trying to add block to existing panel. » AJAX/PHP error "ParagraphBlocksEntityManager::__construct() must implement interface ConfigFactoryInterface" when trying to add block to existing panel.

Updated title.

iamamused’s picture

This can be fixed by adding the missing `@config.factory` argument in `paragraph_blocks.services.yml`

arguments: ['@path.alias_manager', '@entity_type.manager', '@request_stack', '@config.factory']

douggreen’s picture

committed, thanks!

douggreen’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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