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.
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) {
...
Comment | File | Size | Author |
---|---|---|---|
patch.diff | 1.57 KB | dobeerman |
Comments
Comment #1
Dave Cohen CreditAttribution: Dave Cohen commentedThanks 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.
Comment #2
Dave Cohen CreditAttribution: Dave Cohen commentedPushed the original patch. I'm hoping that's all that is needed.