- 🇺🇸United States josephcheek Provo, UT
Patch #10 added support for Checkboxes, Table, and Tableselect, but removed the necessary
isset()
from #3 on those, now giving (D10.0.9, PHP 8.1.18):Warning: Undefined array key "#options" in Drupal\Core\Render\Element\Radios::processRadios() (line 62 of core/lib/Drupal/Core/Render/Element/Radios.php).
Either an
isset()
or my preferentialarray_key_exists()
needs to be added to these to suppress this warning. I've rerolled #10 to add array_key_exists() on all of the changes. - Status changed to RTBC
over 1 year ago 9:48pm 25 May 2023 - last update
over 1 year ago 28,518 pass - last update
over 1 year ago 28,519 pass - last update
over 1 year ago 28,519 pass - last update
over 1 year ago 28,520 pass 35:59 32:39 Running- last update
over 1 year ago 28,520 pass - Open on Drupal.org →Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago 28,522 pass, 2 fail The last submitted patch, 25: 3252288-25.patch, failed testing. View results →
- Status changed to Needs work
over 1 year ago 7:36am 12 June 2023 - Status changed to Needs review
over 1 year ago 7:37am 12 June 2023 - last update
over 1 year ago 30,338 pass - Status changed to Needs work
over 1 year ago 2:36pm 12 June 2023 - 🇺🇸United States smustgrave
Was previously tagged for steps to reproduce, tests, and issue summary update which still need to happen before review.
- 🇮🇳India supriya1992
Step to reproduce
- Create a custom form.
- Add a field of type radios/checkbox/tableselct.
- Make the option to be NULL.
- I also attached the screenshot of the PHP error.
- This can also be reproduced if we use a blank taxonomy term as an exposed filter in view.
$form['testempty'] = [ '#type' => 'tableselect', '#options' => NULL, '#empty' => $this->t('No Data'), ];
Test
- Create a custom form same as above and apply the patch.
- After applying the patch, the form will display blank data. It will not throw a PHP error and the page will not blank with "Website encounter error."
- Status changed to Needs review
over 1 year ago 7:30am 13 June 2023 - Status changed to Needs work
over 1 year ago 12:04pm 13 June 2023 - 🇺🇸United States smustgrave
Proposed solution is still empty and tests appear to be missing
- last update
over 1 year ago 30,371 pass - last update
over 1 year ago 30,371 pass - last update
over 1 year ago 30,348 pass, 2 fail - last update
over 1 year ago 30,371 pass - last update
over 1 year ago 30,338 pass - last update
over 1 year ago 30,338 pass - last update
over 1 year ago 30,362 pass, 1 fail - last update
over 1 year ago 30,371 pass - last update
over 1 year ago 30,337 pass, 1 fail - last update
over 1 year ago 30,371 pass - last update
over 1 year ago 30,371 pass - last update
over 1 year ago 30,371 pass - last update
over 1 year ago 30,371 pass - last update
over 1 year ago 30,338 pass - last update
over 1 year ago 30,338 pass - Status changed to Needs review
over 1 year ago 4:52am 14 June 2023 - 🇮🇳India supriya1992
Hello smustgrave,
The proposed solution has been updated and also added the tests. - Status changed to Needs work
over 1 year ago 3:35pm 14 June 2023 - 🇮🇳India supriya1992
Hello smustgrave ,
I understand your suggestion to create the test case for the patch. Could you suggest where can be written the test case for this? 6:49 3:04 Running- last update
11 months ago 25,847 pass, 1,795 fail - last update
11 months ago 25,834 pass, 1,789 fail - 🇺🇸United States smustgrave
Since the fix is coming out of the core/lib folder tests could probably be added in the tests folder. Would see if a test could be expanded
- 🇺🇸United States smustgrave
Got bit by this nightmare again over in better_exposed_filters.
Cleaning up the tags but still leaving in NW for the tests.
- 🇮🇳India anchal_gupta
I have test this issue in my system and work on it.
provided the patch.Thanks
- 🇬🇧United Kingdom oily Greater London
Hi @anchal_gupta, I am seeing a typo in your patch:
+ if (is_countablet($element['#options']) > 0) {
'is_countablet' should be 'is_countable' I think? - 🇬🇧United Kingdom oily Greater London
I have tried to apply patch 28 but I get errors:
| => curl https://www.drupal.org/files/issues/2023-06-12/argument-countable-null-3... → | git apply --index -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3876 100 3876 0 0 58034 0 --:--:-- --:--:-- --:--:-- 58727
error: patch failed: core/lib/Drupal/Core/Render/Element/Table.php:366
error: core/lib/Drupal/Core/Render/Element/Table.php: patch does not applySo, tried this command instead:
curl https://www.drupal.org/files/issues/2023-06-12/argument-countable-null-3... → | git apply --reject --whitespace=fix --index -That works, but creates a .rej file with the rejected 'hunk'. So it should help identify/ narrow down the problem with the patch.
I also applied patch 43. It applies cleanly but #44 is one apparent error. Also the if conditions appear correct in #28 but not in #44.
- 🇬🇧United Kingdom oily Greater London
The Color.php render element class has this function at line 50:
public static function validateColor(&$element, FormStateInterface $form_state, &$complete_form) {
It contains try catch blocks and thrown an exception. This approach could work.