Index: demo.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/demo/demo.admin.inc,v
retrieving revision 1.1.2.19
diff -u -p -r1.1.2.19 demo.admin.inc
--- demo.admin.inc	17 Jan 2010 19:00:10 -0000	1.1.2.19
+++ demo.admin.inc	28 Mar 2010 19:31:28 -0000
@@ -39,10 +39,10 @@ function demo_admin_settings() {
     '#title' => t('Dump settings'),
   );
 
-
   $form['dump']['demo_dump_path'] = array(
     '#type' => 'textfield',
     '#title' => t('Dump path'),
+    '#required' => TRUE,
     '#default_value' => $fileconfig['path'],
     '#description' => t('Enter a writable directory where dump files of this demonstration site are stored, f.e. %files. The name of this site (e.g. %confpath) is automatically appended to this directory, if required.<br /><br /><strong>Note: For security reasons you should store site dumps outside of the document root of your webspace!</strong>', array('%files' => file_directory_path() . '/demo', '%confpath' => $fileconfig['site'])),
   );
@@ -54,7 +54,7 @@ function demo_admin_settings() {
 /**
  * Form validation handler for demo_admin_settings().
  */
-function demo_admin_settings_submit($form, &$form_state) {
+function demo_admin_settings_validate($form, &$form_state) {
   if (!file_check_directory($form_state['values']['demo_dump_path'], FILE_CREATE_DIRECTORY)) {
     form_set_error('demo_dump_path', t('The snapshot directory %directory could not be created.', array('%directory' => $form_state['values']['demo_dump_path'])));
   }
@@ -322,7 +322,8 @@ function demo_get_fileconfig($filename =
   $fileconfig = array();
 
   // Build dump path.
-  $fileconfig['path'] = variable_get('demo_dump_path', file_directory_path() . '/demo');
+  $dump_path = variable_get('demo_dump_path', file_directory_path() . '/demo');
+  $fileconfig['path'] = (!is_dir($dump_path) && !@mkdir($dump_path)) ? file_directory_path() . '/demo' : $dump_path;
   $fileconfig['dumppath'] = $fileconfig['path'];
   // Append site name if it is not included in file_directory_path() and if not
   // storing files in sites/all/files.
