Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#9 | context_scalar_values_fix.patch | 799 bytes | nkoporec |
#5 | use_scalar_value_as_array-2865345-5.patch | 502 bytes | johnhuang0808 |
#4 | warning.png | 141.79 KB | johnhuang0808 |
#2 | use_scalar_value_as_array-2865345-2.patch | 548 bytes | alex_optim |
Comments
Comment #2
alex_optimOn "Edit context" page, when click button "Add reaction" error occurs
Warning: Cannot use a scalar value as an array in Drupal\Core\Render\Element\RenderElement::preRenderAjaxForm() (line 315 of...
Create patch how fixed this error.
Comment #3
icurk CreditAttribution: icurk commentedI can't reproduce this error. Are you still having this issue? Which version of Drupal core are you using? If you still have this issue, better patch would be to delete this line
'#ajax' => TRUE
since ajax is already triggered by use-ajax class on link.Comment #4
johnhuang0808 CreditAttribution: johnhuang0808 at Fliegen commentedI also encountered the same issue when clicking the "Add reaction" button.
Edit: The Drupal core is 8.3.4.
Comment #5
johnhuang0808 CreditAttribution: johnhuang0808 at Fliegen commentedAccording to @icurk's suggestion, I remove the
'#ajax' => TRUE
. It works for me.Comment #6
jayemel CreditAttribution: jayemel commentedSame issue here on 8.4.4. Removing
'#ajax' => TRUE
does not solve it for me.Comment #7
Janez Zibelnik CreditAttribution: Janez Zibelnik at Agiledrop - Your Trusted Drupal Teammates commentedIt is working for me on 8.4.4. Removing the "#ajax" removes the element from the if statement that contained the switch statement that was throwing the error in the first place.
Comment #8
KarimBou CreditAttribution: KarimBou commentedSame issue here with 8.4.4, 8.5.0-beta1 and 8.5.0-rc1
Comment #9
nkoporecHave the same issue, running latest drupal and context dev branch.Created a patch with a fix that was suggested by icurk.
Comment #10
interdruper CreditAttribution: interdruper at Interdruper commentedI can confirm that #5 or #9 fix the issue, Drupal 8.5.0 and Context 8.x-4.0-beta2+11-dev.
Comment #12
boshtian CreditAttribution: boshtian at Agiledrop - Your Trusted Drupal Teammates commented