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).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

extrarumeno’s picture

Subscribe..........

BenK’s picture

Subscribing

emkamau’s picture

Same error here.
emk

ryandekker’s picture

Title: NFC doesn't work with Hierarchical Select module » Recoverable fatal error when node form processed programmatically
Project: Node form columns » Hierarchical Select
Version: 7.x-1.x-dev » 7.x-3.x-dev
Status: Active » Needs review
FileSize
852 bytes

I 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):

  $fs = array(
    'build_info' => array('args' => array($node)),
  );
  $fs += form_state_defaults();
  $nf = drupal_retrieve_form($nfid, $fs);
  drupal_prepare_form($nfid, $nf, $fs);
  drupal_process_form($nfid, $nf, $fs);
  return $nf;

form_state_defaults() doesn't return a $form_state['input'], but Hierarchical Select depends on it for it's call to drupal_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 by form_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):

  $fs = array(
    'build_info' => array('args' => array($node)),
    'input' => array(),
  );
stefan.r’s picture

Issue summary: View changes
Status: Needs review » Fixed

  • stefan.r committed 704b456 on 7.x-3.x authored by ryandekker
    Issue #1162204 by ryandekker: Recoverable fatal error when node form...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.