Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.137
diff -u -r1.137 upload.module
--- modules/upload/upload.module 21 Nov 2006 20:14:19 -0000 1.137
+++ modules/upload/upload.module 22 Nov 2006 04:01:42 -0000
@@ -372,13 +372,22 @@
'#weight' => 30,
);
+
// Wrapper for fieldset contents (used by upload JS).
$form['attachments']['wrapper'] = array(
'#prefix' => '
',
'#suffix' => '
',
);
- $form['attachments']['wrapper'] += _upload_form($node);
- $form['#attributes']['enctype'] = 'multipart/form-data';
+ if (!file_check_directory(file_directory_path())) {
+ $form['attachments']['wrapper'] = array (
+ '#type' => 'markup',
+ '#value' => t('Attachments are disabled because %path is not writable', array('%path' => file_directory_path())),
+ );
+ }
+ else {
+ $form['attachments']['wrapper'] += _upload_form($node);
+ $form['#attributes']['enctype'] = 'multipart/form-data';
+ }
}
}
}
@@ -881,3 +890,4 @@
print drupal_to_js(array('status' => TRUE, 'data' => $output));
exit;
}
+