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.
I'm getting this error and don't know what to make of it:
Error message
Recoverable fatal error: Argument 1 passed to drupal_array_set_nested_value() must be an array, null given, called in C:\wamp\www\cruzr\sites\all\modules\hierarchical_select\hierarchical_select.module on line 771 and defined in drupal_array_set_nested_value() (line 6185 of C:\wamp\www\cruzr\includes\common.inc).
Comment | File | Size | Author |
---|---|---|---|
#4 | hierarchical_select-support_programmatic_form_processing-1162204-4.patch | 852 bytes | ryandekker |
Comments
Comment #1
extrarumeno CreditAttribution: extrarumeno commentedSubscribe..........
Comment #2
BenK CreditAttribution: BenK commentedSubscribing
Comment #3
emkamau CreditAttribution: emkamau commentedSame error here.
emk
Comment #4
ryandekker CreditAttribution: ryandekker commentedI think this issue is actually with Hierarchical Select.
NFC uses this code to grab the processed form elements (in function_nodeformcols_get_node_type_form):
form_state_defaults()
doesn't return a$form_state['input']
, but Hierarchical Select depends on it for it's call todrupal_array_set_nested_value($form_state['input'], $element['#array_parents'], array());
(the line causing the fatal). The above seems like a pretty standard way of programmatically processing a form. I think it's a bit reckless to depend on something that isn't returned byform_state_defaults()
.Wrapping it in an if statement fixes the issue with NFC for me, and should smooth over issues with any other modules that would use this method.
Attached is patch for the if wrap. If I'm wrong and this is a problem with NFC, the obvious fix is to add 'input' to the $fs array (untested):
Comment #5
stefan.r CreditAttribution: stefan.r commented