You need to use $var instead $var_prefix in $form['fb_stream'][$var_prefix].

$var_prefix = 'fb_stream_enabled_';
$var = $var_prefix . '_' . $node_type;
$form['fb_stream'][$var_prefix] = array(
...

use this code

$var_prefix = 'fb_stream_enabled_';
$var = $var_prefix . '_' . $node_type;
$form['fb_stream'][$var] = array(
...

also in hook_node_presave you should to use this code

function MODULE_node_presave($node) {
  $fb_stream_enabled = variable_get('fb_stream_enabled__'. $node->type, 0);
  if ($fb_stream_enabled) {
  ...
CommentFileSizeAuthor
patch.diff1.57 KBdobeerman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Cohen’s picture

Thanks for catching that. Not sure how I missed it.

I'm not understanding the last part about hook_node_presave. If additional changes need to be made, please include them in the patch.

Dave Cohen’s picture

Status: Active » Fixed

Pushed the original patch. I'm hoping that's all that is needed.

Status: Fixed » Closed (fixed)

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