- Issue created by @Hitby
- Status changed to Needs review
over 1 year ago 10:52am 29 March 2023 - 🇺🇸United States bill_redman
I am running D9.5.7 & PHP 8.1.14 and was receiving the warning noted in this issue. I then applied the patch in #3 but it did not resolve the problem. Instead, it resulted in a new error when I try to view the site. Full trace follows:
TypeError: array_values(): Argument #1 ($array) must be of type array, null given in array_values() (line 385 of /code/web/modules/composer/gtranslate/src/Plugin/Block/GTranslateBlock.php) #0 /code/web/modules/composer/gtranslate/src/Plugin/Block/GTranslateBlock.php(385): array_values(NULL) #1 /code/web/core/modules/block/src/BlockViewBuilder.php(171): Drupal\gtranslate\Plugin\Block\GTranslateBlock->build() #2 [internal function]: Drupal\block\BlockViewBuilder::preRender(Array) #3 /code/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array) #4 /code/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...') #5 /code/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) #6 /code/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender(Array) #7 /code/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false) #8 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render(Array) #9 /tmp/rolling/0b8bbd3/twig/642ed7ecae20a_page.html.twig_jod-O8i4TQnhYu4BU5Poqv1d3/UUPFVvXA-EMU2aa171IsKyhTXPFsfS-a96nsxJz4odw.php(51): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true) #10 /code/vendor/twig/twig/src/Template.php(405): __TwigTemplate_5d0be2524ad31eab9c86f4f6c4c40ed6->doDisplay(Array, Array) #11 /code/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array) #12 /code/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array) #13 /code/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render(Array) #14 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/professi...', Array) #15 /code/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render('page', Array) #16 /code/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false) #17 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render(Array) #18 /tmp/rolling/0b8bbd3/twig/642ed7ecae20a_html.html.twig_vB85B8YBCzHCJFi3sUmfz3yYn/EPqyBhT_Yuh6g3nsZLDt8y7Ak6YTmyfg5WS0QUHAWJY.php(84): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true) #19 /code/vendor/twig/twig/src/Template.php(405): __TwigTemplate_925d292f0ae928418ef973f4ad096b6a->doDisplay(Array, Array) #20 /code/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array) #21 /code/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array) #22 /code/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render(Array) #23 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/professi...', Array) #24 /code/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render('html', Array) #25 /code/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false) #26 /code/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(162): Drupal\Core\Render\Renderer->render(Array) #27 /code/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() #28 /code/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(163): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #29 /code/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch)) #30 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #31 /code/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #32 /code/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view') #33 /code/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #34 /code/web/modules/composer/redirect_after_login/src/RedirectMiddleware.php(46): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #35 /code/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\redirect_after_login\RedirectMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #36 /code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #37 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #38 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #39 /code/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #40 /code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #41 /code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #42 /code/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #43 /code/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #44 /code/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #45 {main}
I can view my site normally if I disable the GTranslate block.
Any thoughts?
- 🇺🇸United States mmarler
Looks like the configuration settings have completely changed in the 3.0.1 version. To fix this error, import the new configuration settings in gtranslate.settings.yml. You'll then need to reconfigure the settings.
- 🇺🇸United States bill_redman
@mmarler, thanks for the information. Since I'm in the process of upgrading my site to D10, I'm going to deal with this after that's done.
- First commit to issue fork.
- 🇨🇦Canada RobLoach Earth
Updated with a few more fixes over at the MR at https://git.drupalcode.org/project/gtranslate/-/merge_requests/12 . Increasing priority since Drupal 10 is the new hawtness, and so is PHP 8.3.
Patch: https://git.drupalcode.org/project/gtranslate/-/merge_requests/12.diff
- Assigned to agunjan085
- Issue was unassigned.
- Status changed to RTBC
over 1 year ago 3:33pm 20 June 2023 - 🇮🇳India agunjan085
Tested MR https://git.drupalcode.org/project/gtranslate/-/merge_requests/12 on Drupal 10 working fine for me
- 🇮🇳India abhisekmazumdar India
I can confirm that after I upgraded this module from `drupal/gtranslate` 1.15.0 to 3.0.1 with Drupal 9.5, I am experiencing the mentioned WSFD with these error messages.
Applying these patches resolves the issue.
- 🇺🇸United States AaronBauman Philadelphia
3.0.1 version causes a WSOD and this patch fixes it.
RTBC+1please commit
- 🇬🇧United Kingdom londova
@edo888
Is anybody capable to release a new version with this issue updated?
It's a shame to have the solution and not update the module for 4 month. - Status changed to Needs work
3 months ago 1:25pm 16 August 2024 - 🇺🇦Ukraine pingwin4eg Zaporizhia 🇺🇦
I see the same warning, but on the "GTranslate Settings" page, right after installing the module and visiting the page.
GTranslate module 3.0.1
Drupal 10.2.5
PHP 8.1.28Warning: foreach() argument must be of type array|object, string given in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 113 of core/lib/Drupal/Core/Render/Element/Checkboxes.php). Drupal\Core\Render\Element\Checkboxes::valueCallback(Array, , Object) call_user_func_array(Array, Array) (Line: 1285) Drupal\Core\Form\FormBuilder->handleInputElement('gtranslate_admin', Array, Object) (Line: 1006) Drupal\Core\Form\FormBuilder->doBuildForm('gtranslate_admin', Array, Object) (Line: 1076) Drupal\Core\Form\FormBuilder->doBuildForm('gtranslate_admin', Array, Object) (Line: 1076) Drupal\Core\Form\FormBuilder->doBuildForm('gtranslate_admin', Array, Object) (Line: 579) Drupal\Core\Form\FormBuilder->processForm('gtranslate_admin', Array, Object) (Line: 325) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32) Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- 🇨🇦Canada RobLoach Earth
The Merge Request still applies cleanly. Here's the patch.
- Status changed to RTBC
18 days ago 3:31pm 28 October 2024