TypeError: array_values(): Argument #1 ($array) must be of type array, null given in array_values() (line 385 of modules/contrib/gtranslate/src/Plugin/Block/GTranslateBlock.php).
Drupal\gtranslate\Plugin\Block\GTranslateBlock->build() (Line: 138)
Drupal\twig_tweak\View\BlockViewBuilder->build('gtranslate_block', Array, ) (Line: 147)
Drupal\twig_tweak\TwigTweakExtension::drupalBlock('gtranslate_block', Array, ) (Line: 763)
__TwigTemplate_48ffa98a1a0529e691df516cd18744f0->doDisplay(Array, Array) (Line: 394)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 367)
Twig\Template->display(Array) (Line: 379)
Twig\Template->render(Array, Array) (Line: 40)
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3415650-gtranslate-11.patch | 1.04 KB | kolesnikoff |
| #6 | 3415650-2-gtranslate.patch | 2 KB | kandugatlasantosh |
| #2 | 3415650-gtranslate.patch | 911 bytes | kandugatlasantosh |
Issue fork gtranslate-3415650
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kandugatlasantosh commentedIssue with the array null check
Comment #5
chetan 11 commentedPlease check the above MR.
Comment #6
kandugatlasantosh commentedUpdate with more null check
Comment #7
no sssweat commentedThe second patch from #6 introduces
Lets analyze:
$float_position = $settings->get('float_position');Float position will never be an array and will always be a string since you can only select one. Therefore,
Is not necessary and it's introducing the undefined variables, as it will never pass this check.
Use the first patch from comment #2 if anything.
Comment #8
mdsohaib4242 commentedThis worked for me.
Comment #9
vagelis-prokopiou commentedThis worked for me:
Module version: 3.0.4
PHP: 8.3
Comment #11
kolesnikoff commentedPatch based on the comment #9
Comment #12
dburiak commentedThe patch #11 can't be applied to gtranslate 3.0.5.