diff --git a/README.txt b/README.txt
index 00a2492..ae55e86 100755
--- a/README.txt
+++ b/README.txt
@@ -1,13 +1,10 @@
 
-The wf_required_fields module allows you to configure which fields of a CCK node
-are required, based on the workflow state of the node.
+The wf_required_fields module allows you to configure which fields of a node are
+required, based on the workflow state of the node.
 
 Required fields are marked on the node edit form. Also transitions are objected
 (with a suitable message) if required fields for the target state are missing.
 
-The module was tested with the field types that come with the CCK module. It
-should also work with other CCK field types that use CCK for database storage.
-
 Installation
 ------------
 
@@ -15,8 +12,9 @@ Installation
    automatically detect the module. Enable the module on the modules'
    administration page.
 
-2. Go to admin/build/wf-required-fields to configure which content types to
-   use, and which fields should be required fields in which workflow state.
+2. Go to admin/config/workflow/wf-required-fields to configure which content
+   types to use, and which fields should be required fields in which workflow
+   state.
 
 Authors
 -------
diff --git a/wf_required_fields.inc b/wf_required_fields.inc
index f9cd4f5..064ed8c 100644
--- a/wf_required_fields.inc
+++ b/wf_required_fields.inc
@@ -1,6 +1,5 @@
 <?php
 
-
 /**
  * Retrieves applicable content types.
  *
@@ -13,10 +12,10 @@ function wf_required_fields_get_types_applicable() {
   static $cache = null;
   if ($cache === null) {
     $cache = array();
-    $types = content_types();
+    $types = node_type_get_types();
     foreach ($types as $key => $value) {
-      if (workflow_get_workflow_for_type($key) !== false) {
-        $cache[$key] = $value['name'];
+      if (workflow_get_workflow_type_map_by_type($key) !== false) {
+        $cache[$key] = $value->name;
       }
     }
   }
@@ -47,7 +46,7 @@ function wf_required_fields_get_types_configured() {
  */
 function wf_required_fields_is_required($type, $field, $sid) {
   $settings = variable_get( 'wf_required_fields', array() );
-  if (! isset($settings['settings'][$type]['table'][$field][$sid]['required'])) {
+  if (!isset($settings['settings'][$type]['table'][$field][$sid]['required'])) {
     return false;
   }
   return $settings['settings'][$type]['table'][$field][$sid]['required'];
@@ -63,7 +62,7 @@ function wf_required_fields_is_required($type, $field, $sid) {
  *  if none found
  */
 function &wf_required_fields_find_required(&$array, $field) {
-  if (! is_array($array)) {
+  if (!is_array($array)) {
     return null;
   }
   if (array_key_exists($field, $array)) {
@@ -86,7 +85,7 @@ function &wf_required_fields_find_required(&$array, $field) {
  * @return array The array that has the $key; null if none found
  */
 function &wf_required_fields_get_if_recursive_subkey(&$array, $key) {
-  if (! is_array($array)) {
+  if (!is_array($array)) {
     return null;
   }
   if (array_key_exists($key, $array)) {
@@ -118,21 +117,16 @@ function wf_required_fields_get_missing_fields($node, $sid) {
   $non_empty = array('0', 0);
   $missing = array();
   $type = $node->type;
-  $all_fields = content_fields();
-  foreach ($all_fields as $key => $value) {
-    if (isset($node->$key)) {
-      $fields[$key] = $value;
-    }
-  }
-  foreach (array_keys($fields) as $field_name) {
-    $info = content_database_info($fields[$field_name]);
-    foreach (array_keys($info['columns']) as $column) {
-      $field = $node->$field_name;
+  $all_fields = field_info_fields();
+  $instances = field_info_instances('node', $type);
+  foreach ($instances as $field_name => $instance) {
+    foreach (array_keys($all_fields[$field_name]['columns']) as $column) {
+      $field = $node->{$field_name}[$node->language];
       if (wf_required_fields_is_required($type, $field_name, $sid)) {
         $first_field_element = array_shift($field);
         $value = $first_field_element[$column];
         if (!in_array($value, $non_empty, true) && empty($value)) {
-          $missing[$field_name] = $all_fields[$field_name]['widget']['label'];
+          $missing[$field_name] = $instance['label'];
         }
       }
     }
@@ -146,31 +140,32 @@ function wf_required_fields_get_missing_fields($node, $sid) {
  * @param array $array The Forms API element
  */
 function wf_required_fields_set_required(&$element) {
-  #drupal_set_message("wf_required_fields_set_required()");
-  #dsm($element);
-
   foreach (element_children($element) as $key) {
-    if (isset($element[$key]) && $element[$key]) {
-
+    if (isset($element[$key]) && $element[$key]
+      && (!isset($element['#type']) || !in_array($element['#type'], array('radios','checkboxes')))) {
       // Recurse through all children elements.
       wf_required_fields_set_required($element[$key]);
     }
   }
 
-  $element['#required'] = '1';
-  switch ($element['#type']) {
-    case 'select':
-      $index = array_search(t('<none>'), $element['#options']);
-      if ($index !== false) {
-        unset ($element['#options'][$index]);
-      }
-      $index2 = array_search('---', $element['#options']);
-      if ($index2 !== false) {
-        unset ($element['#options'][$index2]);
-      }
-      break;
+  if (isset($element['#type'])) {
+    $element['#required'] = '1';
+    $none = array('- None -', '---', '<none>');
+    switch ($element['#type']) {
+      case 'select':
+        foreach ($none as $opt) {
+          $i = array_search(t($opt), $element['#options']);
+          if ($i !== false) {
+            unset($element['#options'][$i]);
+          }
+        }
+        break;
 
-    case 'radios':
-        unset ($element['#options']['']);
+      case 'radios':
+        if (isset($element['_none'])) {
+          $element['_none']['#access'] = FALSE;
+        }
+        unset($element['#options']['_none']);
+    }
   }
 }
\ No newline at end of file
diff --git a/wf_required_fields.info b/wf_required_fields.info
index ee7a1de..b622d4a 100644
--- a/wf_required_fields.info
+++ b/wf_required_fields.info
@@ -1,6 +1,5 @@
 name = Workflow required fields
-description = "Sets requirements on CCK fields depending on the workflow state of the node."
+description = "Sets requirements on fields depending on the workflow state of the node."
 package = Workflow
-dependencies[] = content
 dependencies[] = workflow
-core = 6.x
\ No newline at end of file
+core = 7.x
\ No newline at end of file
diff --git a/wf_required_fields.module b/wf_required_fields.module
index bdb7607..30f9534 100644
--- a/wf_required_fields.module
+++ b/wf_required_fields.module
@@ -1,8 +1,5 @@
 <?php
 
-
-module_load_include('inc', 'wf_required_fields', 'wf_required_fields');
-
 /**
  * Implementation of hook_menu().
  * 
@@ -13,19 +10,18 @@ module_load_include('inc', 'wf_required_fields', 'wf_required_fields');
  */
 function wf_required_fields_menu() {
   $items = array();
-  $items['admin/build/wf-required-fields'] = array(
+  $items['admin/config/workflow/wf-required-fields'] = array(
     'title'              => 'Workflow Required Fields',
     'description'        => 'Choose the content types that you want to have state dependant required fields. For each such content type and each state, configure the fields that you want to be required.',
     'page callback'      => 'drupal_get_form',
     'page arguments'     => array('wf_required_fields_settings_form'),
-    'access callback'    => 'user_access',
     'access arguments'   => array('administer site configuration'),
   );
   return $items;
 }
 
 /**
- * Implementation of hook_form_alter().
+ * Implementation of hook_form_BASE_FORM_ID_alter().
  * 
  * Sets the '#required' property of configured fields in node edit forms. 
  * 
@@ -34,16 +30,13 @@ function wf_required_fields_menu() {
  * @todo Eliminate (or disable) fields that are required on the cck field
  *  configuration page
  */
-function wf_required_fields_form_alter(&$form, &$form_state, $form_id) {
-  if ($form['#id'] !== 'node-form' || !isset($form['type']) || !isset($form['#node'])) {
-    return; // wrong form
-  }
+function wf_required_fields_form_node_form_alter(&$form, &$form_state, $form_id) {
+  module_load_include('inc', 'wf_required_fields', 'wf_required_fields');
   $type = $form['#node']->type;
   $types = wf_required_fields_get_types_configured();
   if (isset($types[$type])) {  
     $form['#after_build'][] = '_wf_required_fields_after_build';
   }
-  
 }
 
 
@@ -51,15 +44,15 @@ function wf_required_fields_form_alter(&$form, &$form_state, $form_id) {
 * Custom after_build callback handler.
 */
 function _wf_required_fields_after_build($form, &$form_state) {
+  module_load_include('inc', 'wf_required_fields', 'wf_required_fields');
   $sid = workflow_node_current_state($form['#node']);
   $type = $form['#node']->type;
-  $info = content_types($type);
-  $fields_available = $info['fields'];
+  $fields_available = field_info_instances('node', $type);
   
   foreach (array_keys($fields_available) as $field) {
     if (wf_required_fields_is_required($type, $field, $sid)) {
       $array =& wf_required_fields_find_required($form, $field);
-      if ($array !== null) {
+      if ($array !== null && (!isset($array['#access']) || $array['#access'])) {
         wf_required_fields_set_required($array);
       }
     }
@@ -73,6 +66,7 @@ function _wf_required_fields_after_build($form, &$form_state) {
  * @return array Forms API array for the configuration page
  */
 function wf_required_fields_settings_form() {
+  module_load_include('inc', 'wf_required_fields', 'wf_required_fields');
   $form = array();
   $form['wf_required_fields'] = array(
     '#tree' => true,
@@ -106,8 +100,9 @@ function wf_required_fields_settings_form() {
 
   // For each content type, present a matrix with states and fields; and checkboxes to click.
   foreach ($types_configured as $type) {
-    $wid = workflow_get_workflow_for_type($type);
-    $states = workflow_get_states($wid);
+    // Workflow doesn't like string arguments here, so make sure it's int.
+    $wid = (int)workflow_get_workflow_type_map_by_type($type)->wid;
+    $states = workflow_get_workflow_states_by_wid($wid);
     $form['wf_required_fields']['settings'][$type] = array(
       '#type' => 'fieldset',
       '#title' => $types_applicable[$type],
@@ -116,32 +111,37 @@ function wf_required_fields_settings_form() {
       '#collapsed' => false,
     );
     $table_header = '<thead><th>'. t('Field') . '\\' . t('State') . '</th>';
-    foreach ($states as $sid => $sname) {
-      $table_header .= "<th>$sname</th>";
+    foreach ($states as $state) {
+      $table_header .= "<th>{$state->state}</th>";
     }
     $table_header .= '</thead>';
     drupal_add_js('misc/tableheader.js');
     $form['wf_required_fields']['settings'][$type]['table'] = array(
-      '#prefix' => '<table class=sticky-enabled><tbody>',
-      '#value' => $table_header,
+      '#type' => 'item',
+      '#prefix' => '<table class="sticky-enabled">'.$table_header.'<tbody>',
       '#suffix' => '</tbody></table>'
     );
-    $info = content_types($type);
-    ksort($info['fields']);
+    $fields = field_info_instances('node', $type);
     $row = 0;
-    foreach ($info['fields'] as $field => $field_info) {
+    foreach ($fields as $field => $field_info) {
+      $name = check_plain($field_info['label'].' ('.$field.')');
+      $rowclass = ($row = 1 - $row) ? 'even' : 'odd';
+      $already = '';
+      if ($field_info['required']) {
+        $link = l('global settings', "admin/structure/types/manage/$type/fields/$field");
+        $already = '<br><em>' . t('Already marked required in its !link', array('!link' => $link)) . '</em>';
+      }
       $form['wf_required_fields']['settings'][$type]['table'][$field] = array(
-        '#prefix' => '<tr class="' . (($row = 1 - $row) ? 'even' : 'odd'). '">',
-        '#value' => '<td>' . $field_info['widget']['label'] . ($field_info['required'] ? '<br><em>' . t('Already marked required in its !link', array('!link' => l('global settings', "admin/content/node-type/$type/fields/". $field_info['field_name']))) : ''),
+        '#prefix' => '<tr class="' . $rowclass . '"><td>' . $name . $already . '</td>',
         '#suffix' => '</tr>',
       );
-      foreach ($states as $sid => $sname) {
-        $form['wf_required_fields']['settings'][$type]['table'][$field][$sid]['required'] = array(
+      foreach ($states as $state) {
+        $form['wf_required_fields']['settings'][$type]['table'][$field][$state->sid]['required'] = array(
           '#prefix' => '<td>',
           '#suffix' => '</td>',
           '#type' => 'checkbox',
           '#title' => '',
-          '#default_value' => wf_required_fields_is_required($type, $field, $sid),
+          '#default_value' => wf_required_fields_is_required($type, $field, $state->sid),
           '#disabled' => $field_info['required'],
         );
       }      
@@ -164,14 +164,14 @@ function wf_required_fields_settings_form() {
  */
 function wf_required_fields_workflow($op, $old_sid, $new_sid, $node) {
   $types = wf_required_fields_get_types_configured();
-  if (! isset($types[$node->type])) {
+  if (!isset($types[$node->type])) {
     return;
   }
   switch ($op) {
     case 'transition pre':
       $missing = wf_required_fields_get_missing_fields($node, $new_sid);
-      if (! empty($missing)) {
-        $state = workflow_get_state($new_sid);
+      if (!empty($missing)) {
+        $state = workflow_get_workflow_states_by_sid($new_sid);
         $list = '<ul>';
         foreach ($missing as $value) {
           $list .= '<li>' . check_plain(t($value)) . '</li>';
@@ -182,7 +182,7 @@ function wf_required_fields_workflow($op, $old_sid, $new_sid, $node) {
             'Cannot promote "!title" to state %state. The following fields are empty: !list',
             array(
               '!title' => l($node->title, $node->nid),
-              '%state' => $state['state'],
+              '%state' => $state->state,
               '!list' => $list,
             )
           )
