Index: restricted_content.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/restricted_content/restricted_content.module,v
retrieving revision 1.8
diff -u -p -r1.8 restricted_content.module
--- restricted_content.module	28 Jan 2009 17:25:34 -0000	1.8
+++ restricted_content.module	22 Apr 2009 14:08:34 -0000
@@ -46,10 +46,9 @@ function restricted_content_node_form(&$
     '#title' => t('Restricted Access'),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
-    '#tree' => TRUE,
     '#access' => restricted_content_form_access($form['uid']['#value']),
   );
-  $form['restricted_content']['rids'] = array(
+  $form['restricted_content']['restricted_content_rids'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Restrict access to users with the following user roles'),
     '#description' => t('If no roles are selected, the node will be viewable by all users.'),
@@ -61,7 +60,13 @@ function restricted_content_node_form(&$
 
 function restricted_content_node_form_submit($form, $form_state) {
   $nid = $form_state['values']['nid'];
-  $rids = array_keys(array_filter($form_state['values']['restricted_content']['rids']));
+
+  // Nasty hack to make node_import work - $form_state['values']['nid'] not
+  // available.
+  if (!$nid) {
+    $nid = db_result(db_query('SELECT MAX(nid) FROM {node}')) + 1;
+  }
+  $rids = array_keys(array_filter($form_state['values']['restricted_content_rids']));
   db_query("DELETE FROM {restricted_content} WHERE nid = %d", $nid);
   if ($rids) {
     db_query("INSERT INTO {restricted_content} VALUES (%d, '%s')", $nid, serialize($rids));
