- Issue created by @oily
- last update
about 1 year ago 2,163 pass - @andrewfarquharson opened merge request.
- last update
about 1 year ago 2,159 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,124 pass - last update
about 1 year ago 2,163 pass - Status changed to Needs review
about 1 year ago 2:53am 18 November 2023 - 🇸🇰Slovakia poker10
This is a problem in
Strongarm
module intheme_strongarm_admin_form
:foreach (element_children($form['name']) as $name) { $row = array(); $row[] = isset($form['revert'][$name]) ? drupal_render($form['revert'][$name]) : ''; $row[] = drupal_render($form['name'][$name]); $row[] = drupal_render($form['storage'][$name]); $row[] = drupal_render($form['value'][$name]); $rows[] = $row; }
$form['name']
is NULL.Drupal core cannot "babysit" broken code, this needs to be fixed in that module. Thanks.
- 🇬🇧United Kingdom oily Greater London
@poker10 Hmm. I will look into this. I believe I have made the configuration form work when it was broken. I am not sure that following strict principles to prevent 'hiding' problems is necessary and thought I was being pragmatic! D7 has limited lifespan and I need to use it in production. I am sharing my own pragmmatic fixes as there may be others doing what I am. The root cause I believe is D7 with PHP 8.1. The error does not seem to appear with earlier version. You fix might be better but not sure its worth the extra effort? Strongarm has been superseded in D8 onwards.
- 🇸🇰Slovakia poker10
@andrew.farquharson Thanks for working on this and for your efforts. This was not a problem on earlier PHP versions because TypeErrors were only warnings before and therefore the page was displayed/working (though there were warnings in watchdog as well).
We cannot fix something, that is not broken in Drupal core. The function
element_children
expects in the first parameter an array (https://api.drupal.org/api/drupal/includes%21common.inc/function/element...). If some module passes NULL or other invalid value, it is not a responsibility of Drupal core to handle this. Modules are responsible when working with Drupal core APIs. So this can be fixed easily onStrongarm
side checking the value before passing it to theelement_children
. Code in Drupal core works as intended. - 🇬🇧United Kingdom oily Greater London
@poker10 I disagree. Others may agree. Good luck.
- Status changed to Closed: duplicate
about 1 year ago 4:04pm 21 November 2023