Closed (fixed)
Project:
radix
Version:
6.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Nov 2023 at 08:47 UTC
Updated:
6 Dec 2023 at 08:19 UTC
Jump to comment: Most recent
The 6.0.x branch is broken, and won't render, giving only an ugly error message.
This commit breaks Radix for me. All prior commits are fine, this and all subsequent commits are broken. The error message I get blames form.twig.
The website encountered an unexpected error. Please try again later.
Twig\Error\RuntimeError: The merge filter only works with arrays or "Traversable", got "NULL" as second argument. in twig_array_merge() (line 22 of themes/contrib/radix/components/form/form.twig).
__TwigTemplate_c337c02e58a347dd9deb9a216e3d8f73->doDisplay(Array, Array) (Line: 394)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 367)
Twig\Template->display(Array) (Line: 39)
__TwigTemplate_120a30412e0b658be1d21c68bcbf0688->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)
Twig\TemplateWrapper->render(Array) (Line: 53)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
amstercadIn components/form/form.twig, replacing this line:
{% set form_utility_classes = form_utility_classes ? form_utility_classes : [] %}with this line allows the website to render again:
{% set utility_classes = utility_classes ? utility_classes : [] %}I'd submit a patch to change it back, but I'm not sure what you were trying to achieve.
Comment #3
doxigo commentedLee is there any template that is passing utility_classes to form.twig? since simply renaming a variable shouldn't break the whole thing and since we are still on the dev branch, we are not that much backward compatible though
the reason for name changing is to be clear on what a utility class is used for
Comment #4
amstercad"utility_classes" are called from all over the place. For example this .yml file.
Comment #5
doxigo commentedDoes changing
utility_classestoform_utility_classesin the yml file and clearing the cache fixes the issue?Comment #6
doxigo commentedAlso that utlity_classes coming from nav component and not from the form component
I believe the error you are getting is not related to the class changes
Comment #7
amstercadI created a clean Drupal site with only Radix 6.0.x and the rendering fails with the same error as written above. That's what I can report for the moment.
Comment #8
amstercadNotice the changes in this code for form.twig.
utility_classesis nowform_utility_classes. Howeverform_utility_classesis used in four places, not three as in the GIT commit in question. With the code below, the website renders fine.That's all I have tested for. I didn't test the form component.
Comment #9
doxigo commentedThanks a lot for the discovery, do you mind to create a MR so I can check?
Comment #12
doxigo commentedThanks for the MR Lee :) appreciate your help, merged
Comment #13
doxigo commented