Skip to content
Snippets Groups Projects
Commit 8b1e5d05 authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

#97231 by pwolanin. Keep the node type in a property and use it consistently.

parent b5bf8a8f
No related branches found
No related tags found
No related merge requests found
......@@ -267,7 +267,7 @@ function comment_form_alter($form_id, &$form) {
$form['workflow']['comment'] = array(
'#type' => 'radios',
'#title' => t('Default comment setting'),
'#default_value' => variable_get('comment_'. $form['identity']['type']['#default_value'], COMMENT_NODE_READ_WRITE),
'#default_value' => variable_get('comment_'. $form['#node_type']->type, COMMENT_NODE_READ_WRITE),
'#options' => array(t('Disabled'), t('Read only'), t('Read/Write')),
'#description' => t('Users with the <em>administer comments</em> permission will be able to override this setting.'),
);
......
......@@ -67,6 +67,8 @@ function node_type_form($type = NULL) {
$type->locked = FALSE;
}
$form['#node_type'] = $type; // Make the type object availabe to implementations of hook_form_alter.
$form['identity'] = array(
'#type' => 'fieldset',
'#title' => t('Identification'),
......
......@@ -348,7 +348,7 @@ function upload_form_alter($form_id, &$form) {
$form['workflow']['upload'] = array(
'#type' => 'radios',
'#title' => t('Attachments'),
'#default_value' => variable_get('upload_'. $form['identity']['type']['#default_value'], 1),
'#default_value' => variable_get('upload_'. $form['#node_type']->type, 1),
'#options' => array(t('Disabled'), t('Enabled')),
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment