Skip to content
Snippets Groups Projects
Commit c297f2e0 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #41161 by Moshe: bugfix: hide the upload form when uploads are not enabled for a node type.

parent 53b5c551
No related branches found
No related tags found
No related merge requests found
......@@ -153,8 +153,8 @@ function upload_form_alter($form_id, &$form) {
);
}
if ($form['type']['#value'] .'_node_form' == $form_id && variable_get("upload_$node->type", 1) == 1 && user_access('upload files')) {
$node = $form['#node'];
$node = $form['#node'];
if ($form['type']['#value'] .'_node_form' == $form_id && variable_get("upload_$node->type", TRUE) && user_access('upload files')) {
drupal_add_js('misc/progress.js');
drupal_add_js('misc/upload.js');
// Clears our files in session when you enter the edit view the first time.
......
......@@ -153,8 +153,8 @@ function upload_form_alter($form_id, &$form) {
);
}
if ($form['type']['#value'] .'_node_form' == $form_id && variable_get("upload_$node->type", 1) == 1 && user_access('upload files')) {
$node = $form['#node'];
$node = $form['#node'];
if ($form['type']['#value'] .'_node_form' == $form_id && variable_get("upload_$node->type", TRUE) && user_access('upload files')) {
drupal_add_js('misc/progress.js');
drupal_add_js('misc/upload.js');
// Clears our files in session when you enter the edit view the first time.
......
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