diff --git a/README.txt b/README.txt
index 9e61342..d783ad1 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,3 @@
-<?php
 
 Patch manager provides a developer tool for managing patches
 to core and contributed modules.
@@ -7,20 +6,51 @@ to core and contributed modules.
 CONTENTS OF THIS FILE
 ---------------------
 
+ * About the developer
  * Requirements
  * Patch naming
  * Configuration
  * More Information
 
+ABOUT THE DEVELOPER
+-------------------
+
+Initial development (D6 version) was made by the user aidanlis.
+Port to D7 was made by the user Staratel.
+
+Hello all! I am Staratel, my name is Dmitry Danilson.
+I am a freelance web developer.
+My goal is to revolutionize the open-source world.
+How? Find the way to monetize open-source projects appropriately.
+What does it mean? It means that such ways as
+- asking for donations
+- contextual links and advertising
+ARE NOT the way we should do it.
+Money - is the only thing that is missing by open-source projects
+to conquer the whole world! :)
+
+That's why I (while doing paid orders) am working on project that 
+will provide this opportunity.
+To finish it I need at least two things:
+1) Greater developer skills : this aim inspired me to make this porting.
+I develop my developer skills - and got the tool that helps me to do it
+even more faster.
+2) Dream team : what else I really need - is a couple of man (if more - not 
+a problem) that are also interested of open-source future.
+If you think that this is amazing theme to work on
+or you have suggestions 
+or you are interested what is the project I am working on 
+or even just have some kind words to say 
+- please feel free to write an email to me : kupifoto@gmail.com .
+Thank you for reading!
+
 REQUIREMENTS
 ------------
 
 The patch_manager module requires the following modules:
   views
-  cck (text submodule)
-  filefield
-  views_bulk_operations (optional)
-  filefield_paths (optional)
+  file
+  views_bulk_operations
 
 It helps to have a working patch binary on your system that
 is executable by the webserver user.
@@ -38,7 +68,7 @@ With tokens, this would be:
   [field_module-raw]-[title]-[field_drupal_issue-raw].patch
   
 You can set this up here:
-  /admin/content/node-type/patch/fields/field_patch
+  /admin/structure/types/manage/patch/fields/field_patch
 
 
 CONFIGURATION
@@ -47,18 +77,17 @@ CONFIGURATION
 Access the configuration page to set the path to your patch
 binary. This will allow you to patch and reverse patches through
 the administration interface.
-  /admin/build/patch
+  /admin/structure/patch
 
 You can start adding patches immediately, as you would a normal node:
   /node/add/patch
 
 You can modify the default fields to store extra information via
 the content module:
-  /admin/content/node-type/patch/fields
+  /admin/structure/types/manage/patch/fields
   
 Everything is powered by Views, so you can modify or create new views:
-  /admin/build/views/edit/patches
-
+  /admin/structure/views/view/patches/edit
 
 MORE INFORMATION
 ----------------
diff --git a/patch_manager.api.php b/patch_manager.api.php
index 9a4f394..0bd7ba6 100644
--- a/patch_manager.api.php
+++ b/patch_manager.api.php
@@ -1,21 +1,22 @@
 <?php
 
 /**
- * @file Document patch_manager API usage
+ * @file
+ * Document patch_manager API usage
  */
 
 /**
- * Implementation of hook_patch().
- */ 
+ * Implements hook_patch().
+ */
 function hook_patch() {
   $patches = array();
-  
+
   $patches[] = array(
     'title'       => t('Allows mailsystem to be hooked'),
     'patch'       => '112311_core_mailsystem_hook.patch',
     'module'      => 'core',
   );
-  
+
   $patches[] = array(
     'title'       => t('Allows cool things'),
     'patch'       => '123112_core_mailsystem_hook.patch',
@@ -24,6 +25,6 @@ function hook_patch() {
     'description' => t('Patches core to allow the cool things to be hooked.'),
     'patchdir'    => 'patches',
   );
-  
+
   return $patches;
 }
diff --git a/patch_manager.drush.inc b/patch_manager.drush.inc
index ef81750..a6959b1 100644
--- a/patch_manager.drush.inc
+++ b/patch_manager.drush.inc
@@ -1,8 +1,11 @@
 <?php
-
+/**
+ * @file
+ * Provide Drush integration to the patch manager
+ */
 
 /**
- * Implementation of hook_drush_command().
+ * Implements hook_drush_command().
  */
 function patch_manager_drush_command() {
   $items = array();
@@ -15,13 +18,13 @@ function patch_manager_drush_command() {
     'options' => array(),
     'examples' => array(),
   );
-  
+
   return $items;
 }
 
 
 /**
- * Implementation of hook_drush_help().
+ * Implements hook_drush_help().
  */
 function patch_manager_drush_help($section) {
   switch ($section) {
@@ -35,22 +38,23 @@ function patch_manager_drush_help($section) {
  * Patch manager command: list patches
  */
 function patch_manager_command_list() {
-  $res = db_query('SELECT nid, title FROM {node} WHERE type="patch"');
-  
+  $res = db_query('SELECT nid, title FROM {node} WHERE type = :type', array(':type' => "patch"));
+
   $rows = array();
   while ($node = db_fetch_object($res)) {
     $rows[] = array(
       $node->nid,
-      $node->title);
+      $node->title,
+    );
   }
-  
+
   $header = array(
     t('#'),
-    t('Title')
+    t('Title'),
   );
-  
-  $tbl = new Console_Table(CONSOLE_TABLE_ALIGN_LEFT , '');    
+
+  $tbl = new Console_Table(CONSOLE_TABLE_ALIGN_LEFT, '');
   $out = $tbl->fromArray($header, $rows);
-  
+
   drush_print($out);
 }
diff --git a/patch_manager.info b/patch_manager.info
index bc8c666..0d61136 100644
--- a/patch_manager.info
+++ b/patch_manager.info
@@ -1,8 +1,12 @@
 name = Patch manager
 description = Provides developer tools for patch management of core and contributed modules.
-core = 6.x
-dependencies[] = views
-dependencies[] = content
+core = 7.x
+version = 7.x-1.x-dev
 dependencies[] = text
-dependencies[] = filefield
-package = Development
\ No newline at end of file
+dependencies[] = file
+dependencies[] = views
+dependencies[] = views_bulk_operations
+package = Development
+files[] = patch_manager.module
+
+
diff --git a/patch_manager.install b/patch_manager.install
index dbcaf03..ef2100a 100644
--- a/patch_manager.install
+++ b/patch_manager.install
@@ -1,157 +1,118 @@
 <?php
- 
 /**
- * Implementation of hook_schema().
+ * @file
+ * Install, update and uninstall functions for the Patch manager module.
+ */
+
+/**
+ * Implements hook_schema().
  */
 function patch_manager_install() {
-  
-  // Install our fields
-  drupal_load('module', 'content');
+  // Install our fields.
   $fields = patch_manager_field_info();
   foreach ($fields as $field) {
-    content_field_instance_create($field);
+    field_create_field($field);
+  }
+  // Create instances for each defined field.
+  $instances = patch_manager_instance_info();
+  foreach ($instances as $instance) {
+    field_create_instance($instance);
   }
-  
-  // Notify the content module about our field formatter
-  content_notify('install', 'patch_manager');
 }
 
-
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
+ * 
+ * @todo Review the conversion of the statement to the D7 database API syntax.
  */
 function patch_manager_uninstall() {
-  
-  // Uninstall our fields
-  module_load_include('inc', 'content', 'includes/content.crud');
+  // Delete instances for each defined field.
+  $instances = field_info_instances('node', 'patch');
+  foreach ($instances as $instance) {
+    field_delete_instance($instance);
+  }
+  // Uninstall our fields.
   $fields = patch_manager_field_info();
   foreach ($fields as $field) {
-    content_field_instance_delete($field['field_name'], $field['type_name']);
+    field_delete_field($field['field_name']);
   }
-  
-  // Remove any actions we created
-  db_query('DELETE FROM {actions} WHERE aid LIKE "patch_manager_%" LIMIT 10');
-
-  // Notify the content module about our field formatter
-  content_notify('uninstall', 'patch_manager');
+  // Remove any actions we created.
+  // TODO Please review the conversion of this statement to the D7 database API
+  // syntax, add LIMIT 10.
+  /* db_query('DELETE FROM {actions} WHERE aid LIKE "patch_manager_%" LIMIT 10') */
+  db_delete('actions')
+  ->condition('aid', "patch_manager_%", 'LIKE')
+  //->range(0,10)
+  ->execute();
 }
 
-
 /**
- * Implementation of hook_enable().
- */
-function patch_manager_enable() {
-  drupal_load('module', 'content');
-  content_notify('enable', 'patch_manager');
-}
-
-
-/**
- * Implementation of hook_disable().
- */
-function patch_manager_disable() {
-  drupal_load('module', 'content');
-  content_notify('disable', 'patch_manager');
-}
-
-
-/**
- * Implementation of hook_field_info().
+ * Implements hook_field_info().
  */
 function patch_manager_field_info() {
+  // We are going to return an array of fields.
   $fields = array();
 
-  // Exported field: field_module
-  $fields['patch-field_module'] = array(
-    'field_name' => 'field_module',
-    'type_name' => 'patch',
-    'widget_active' => '1',
-    'type' => 'text',
-    'required' => '1',
-    'multiple' => '0',
-    'module' => 'text',
+  // field_patch field
+  $fields[] = array(
+    'translatable' => '0',
+    'entity_types' => array(),
+    'settings' => array(
+      'display_field' => 1,
+      'display_default' => 0,
+      'uri_scheme' => 'public',
+    ),
+    'field_name' => 'field_patch',
+    'type' => 'file',
+    'module' => 'file',
     'active' => '1',
-    'text_processing' => '0',
-    'max_length' => '30',
-    'allowed_values' => '',
-    'allowed_values_php' => '',
-    'widget' => array(
-      'rows' => 5,
-      'size' => '30',
-      'default_value' => array(
-        '0' => array(
-          'value' => '',
-          '_error_element' => 'default_value_widget][field_module][0][value',
-        ),
+    'locked' => '0',
+    'cardinality' => '1',
+    'bundles' => array(
+      'node' => array(
+      0 => 'patch',
       ),
-      'default_value_php' => NULL,
-      'label' => 'Module',
-      'weight' => -5,
-      'description' => 'Enter the name of the module this patch should be categorised with, e.g. core, views, cck, taxonomy.',
-      'type' => 'text_textfield',
-      'module' => 'text',
     ),
   );
 
-  // Exported field: field_patch
-  $fields['patch-field_patch'] = array(
-    'field_name' => 'field_patch',
-    'type_name' => 'patch',
-    'widget_active' => '1',
-    'type' => 'filefield',
-    'required' => '1',
-    'multiple' => '0',
-    'module' => 'filefield',
+  // field_module field
+  $fields[] = array(
+    'translatable' => '0',
+    'entity_types' => array(),
+    'settings' => array(
+      'max_length' => '30',
+    ),
+    'field_name' => 'field_module',
+    'type' => 'text',
+    'module' => 'text',
     'active' => '1',
-    'list_field' => '0',
-    'list_default' => 1,
-    'description_field' => '0',
-    'widget' => array(
-      'file_extensions' => 'txt diff patch',
-      'file_path' => 'patches',
-      'progress_indicator' => 'throbber',
-      'max_filesize_per_file' => '',
-      'max_filesize_per_node' => '',
-      'label' => 'Patch file',
-      'weight' => -4,
-      'description' => 'The patch file. This should be a unified diff, created according to the instructions in the <a href="http://drupal.org/node/22568">patch section</a> of the Drupal website. This means the patch should be against the module\'s directory, or against the Drupal root for patches against Drupal\'s core.',
-      'type' => 'filefield_widget',
-      'module' => 'filefield',
+    'locked' => '0',
+    'cardinality' => '1',
+    'bundles' => array(
+      'node' => array(
+        0 => 'patch',
+      ),
     ),
   );
 
-  // Exported field: field_drupal_issue
-  $fields['patch-field_drupal_issue'] = array(
+  // field_drupal_issue field
+  $fields[] = array(
+    'translatable' => '0',
+    'settings' => array(
+      'max_length' => '10',
+    ),
     'field_name' => 'field_drupal_issue',
-    'type_name' => 'patch',
-    'widget_active' => '1',
     'type' => 'text',
-    'required' => '0',
-    'multiple' => '0',
-    'module' => 'text',
     'active' => '1',
-    'text_processing' => '0',
-    'max_length' => '10',
-    'allowed_values' => '',
-    'allowed_values_php' => '',
-    'widget' => array(
-      'rows' => 1,
-      'size' => '60',
-      'default_value' => array(
-        '0' => array(
-          'value' => '',
-          '_error_element' => 'default_value_widget][field_drupal_issue][0][value',
-        ),
+    'locked' => '0',
+    'cardinality' => '1',
+    'bundles' => array(
+      'node' => array(
+        0 => 'patch',
       ),
-      'default_value_php' => NULL,
-      'label' => 'Drupal.org issue number',
-      'weight' => -3,
-      'description' => 'Enter the drupal.org issue number, if one exists (e.g. <em>284899</em>). If the patch comes from a comment on a drupal issue, then include the comment number (e.g. <em>284899/23</em>).',
-      'type' => 'text_textfield',
-      'module' => 'text',
     ),
   );
-  
+
   // Translatables
   // Included for use with string extractors like potx.
   t('Drupal.org issue number');
@@ -160,3 +121,127 @@ function patch_manager_field_info() {
 
   return $fields;
 }
+
+function patch_manager_instance_info() {
+  // We are going to return an array of field instances.
+  $instances = array();
+
+  // field_patch instance
+  $instances[] = array(
+    'label' => 'Patch file',
+    'widget' => array(
+      'weight' => '-4',
+      'type' => 'file_generic',
+      'module' => 'file',
+      'active' => 1,
+      'settings' => array(
+        'progress_indicator' => 'throbber',
+      ),
+    ),
+    'settings' => array(
+      'file_directory' => 'patches',
+      'file_extensions' => 'txt diff patch',
+      'max_filesize' => '',
+      'description_field' => 0,
+      'user_register_form' => FALSE,
+    ),
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'type' => 'file_default',
+        'settings' => array(),
+        'module' => 'file',
+        'weight' => 0,
+      ),
+      'teaser' => array(
+        'type' => 'hidden',
+        'label' => 'above',
+        'settings' => array(),
+        'weight' => 0,
+      ),
+    ),
+    'required' => 1,
+    'description' => '',
+    'field_name' => 'field_patch',
+    'entity_type' => 'node',
+    'bundle' => 'patch',
+  );
+
+  // field_module instance
+  $instances[] = array(
+    'label' => 'Module',
+    'widget' => array(
+      'weight' => '-3',
+      'type' => 'text_textfield',
+      'module' => 'text',
+      'active' => 1,
+      'settings' => array(
+        'size' => '60',
+      ),
+    ),
+    'settings' => array(
+      'text_processing' => '0',
+      'user_register_form' => FALSE,
+    ),
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'type' => 'text_default',
+        'settings' => array(),
+        'module' => 'text',
+        'weight' => 1,
+      ),
+      'teaser' => array(
+        'type' => 'hidden',
+        'label' => 'above',
+        'settings' => array(),
+        'weight' => 0,
+      ),
+    ),
+    'required' => 1,
+    'description' => 'Use the system name of module. For example, <b>feeds_tamper</b>.',
+    'default_value' => NULL,
+    'field_name' => 'field_module',
+    'entity_type' => 'node',
+    'bundle' => 'patch',
+  );
+
+  // field_drupal_issue instance
+  $instances[] = array(
+    'label' => 'Drupal.org issue number',
+    'widget' => array(
+      'weight' => '-2',
+      'type' => 'text_textfield',
+      'active' => 1,
+      'settings' => array(
+        'size' => '60',
+      ),
+    ),
+    'settings' => array(
+      'text_processing' => '0',
+      'user_register_form' => FALSE,
+    ),
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'type' => 'text_default',
+        'settings' => array(),
+        'weight' => 2,
+      ),
+      'teaser' => array(
+        'type' => 'hidden',
+        'label' => 'above',
+        'settings' => array(),
+        'weight' => 0,
+      ),
+    ),
+    'required' => 0,
+    'description' => '',
+    'default_value' => NULL,
+    'field_name' => 'field_drupal_issue',
+    'entity_type' => 'node',
+    'bundle' => 'patch',
+  );
+
+  return $instances;
+}
\ No newline at end of file
diff --git a/patch_manager.module b/patch_manager.module
index cf73747..79a0065 100644
--- a/patch_manager.module
+++ b/patch_manager.module
@@ -1,6 +1,6 @@
 <?php
 /**
- * @file patch_manager.module
+ * @file
  * Patch manager provides developers with tools for managing patches.
  */
 
@@ -13,76 +13,78 @@
  */
 define('PATCH_MANAGER_SUCCESS', 0);
 define('PATCH_MANAGER_WARNING', 1);
-define('PATCH_MANAGER_ERROR',   2);
+define('PATCH_MANAGER_ERROR',     2);
 
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function patch_manager_menu() {
   $items = array();
 
-  $items['admin/build/patch'] = array(
-    'title'            => 'Patches',
-    'description'      => 'Patch management of core and contributed modules.',
+  $items['admin/structure/patch'] = array(
+    'title' => 'Patches',
+    'description' => 'Patch management of core and contributed modules.',
     'access arguments' => array('administer patch manager'),
-    'page callback'    => 'patch_manager_list',
-    'type'             => MENU_NORMAL_ITEM,
+    'page callback' => 'patch_manager_list',
+    'type' => MENU_NORMAL_ITEM,
   );
 
-  $items['admin/build/patch/list'] = array(
-    'title'            => 'List',
-    'description'      => 'List patches stored with the patch manager.',
+  $items['admin/structure/patch/list'] = array(
+    'title' => 'List',
+    'description' => 'List patches stored with the patch manager.',
     'access arguments' => array('administer patch manager'),
-    'type'             => MENU_DEFAULT_LOCAL_TASK,
+    'type' => MENU_DEFAULT_LOCAL_TASK,
   );
 
-  $items['admin/build/patch/configure'] = array(
-    'title'            => 'Configure',
-    'description'      => 'Configure settings for patch manager.',
-    'page callback'    => 'drupal_get_form',
-    'page arguments'   => array('patch_manager_settings_form'),
+  $items['admin/structure/patch/configure'] = array(
+    'title' => 'Configure',
+    'description' => 'Configure settings for patch manager.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('patch_manager_settings_form'),
     'access arguments' => array('administer patch manager'),
-    'weight'           => 30,
-    'type'             => MENU_LOCAL_TASK,
+    'weight' => 30,
+    'type' => MENU_LOCAL_TASK,
   );
 
-  $items['admin/build/patch/add'] = array(
-    'title'            => 'Add',
-    'description'      => 'Add a new patch.',
-    'page callback'    => 'drupal_goto',
-    'page arguments'   => array('node/add/patch'),
+  $items['admin/structure/patch/add'] = array(
+    'title' => 'Add',
+    'description' => 'Add a new patch.',
+    'page callback' => 'drupal_goto',
+    'page arguments' => array('node/add/patch'),
     'access arguments' => array('administer patch manager'),
-    'weight'           => 20,
-    'type'             => MENU_LOCAL_TASK,
+    'weight' => 20,
+    'type' => MENU_LOCAL_TASK,
   );
 
-  $items['admin/build/patch/scan'] = array(
-    'title'            => 'Scan',
-    'description'      => 'Scan for patches.',
-    'page callback'    => 'patch_manager_page_scan',
+  $items['admin/structure/patch/scan'] = array(
+    'title' => 'Scan',
+    'description' => 'Scan for patches.',
+    'page callback' => 'patch_manager_page_scan',
     'access arguments' => array('administer patch manager'),
-    'weight'           => 40,
-    'type'             => MENU_LOCAL_TASK,
+    'weight' => 40,
+    'type' => MENU_LOCAL_TASK,
   );
 
   return $items;
 }
 
-
-
 /**
- * Implementation of hook_perm().
+ * Implements hook_permission().
  */
-function patch_manager_perm() {
-  return array('administer patch manager');
+function patch_manager_permission() {
+  return array(
+    'administer patch manager' => array(
+      'title' => t('administer patch manager'),
+      'description' => t('Patch manager provides developers with tools for managing patches.'),
+    ),
+  );
 }
 
-
 /**
- * Implementation of hook_access().
+ * Implements hook_node_access().
  */
-function patch_manager_access($op, $node, $account) {
+function patch_manager_node_access($node, $op, $account) {
   switch ($op) {
     case 'create':
     case 'update':
@@ -92,49 +94,47 @@ function patch_manager_access($op, $node, $account) {
 }
 
 /**
- * Implementation of hook_form().
+ * Implements hook_form().
  */
 function patch_manager_form(&$node) {
-  $type = node_get_types('type', $node);
+  $type = node_type_get_type($node);
 
   $form['title'] = array(
-    '#type'          => 'textfield',
-    '#description'   => t('Short description of the patch.'),
-    '#title'         => check_plain($type->title_label),
-    '#required'      => TRUE,
-    '#size'          => 50,
-    '#weight'        => -6,
-    '#attributes'    => array('style' => 'width: auto'),
+    '#type' => 'textfield',
+    '#description' => t('Short description of the patch.'),
+    '#title' => check_plain($type->title_label),
+    '#required' => TRUE,
+    '#size' => 50,
+    '#weight' => -6,
+    '#attributes' => array('style' => 'width: auto'),
     '#default_value' => !empty($node->title) ? $node->title : NULL,
   );
 
   $form['body'] = array(
-    '#type'          => 'textarea',
-    '#title'         => check_plain($type->body_label),
-    '#description'   => t('Optional notes for this patch, why is this patch necessary for this site? When can be removed?'),
-    '#required'      => FALSE,
-    '#rows'          => 3,
-    '#weight'        => -2,
+    '#type' => 'textarea',
+    '#title' => check_plain($type->body_label),
+    '#description' => t('Optional notes for this patch, why is this patch necessary for this site? When can be removed?'),
+    '#required' => FALSE,
+    '#rows' => 3,
+    '#weight' => -2,
     '#default_value' => !empty($node->body) ? $node->body : NULL,
   );
 
   return $form;
 }
 
-
 /**
- * Implementation of hook_views_api().
+ * Implements hook_views_api().
  */
 function patch_manager_views_api() {
   return array(
-    'api'  => 2.0,
+    'api' => 3,
     'path' => drupal_get_path('module', 'patch_manager'),
   );
 }
 
-
 /**
- * Implementation of hook_node_info().
+ * Implements hook_node_info().
  *
  * @todo Remove default publish to front page
  */
@@ -142,78 +142,62 @@ function patch_manager_node_info() {
   $items = array();
 
   $items['patch'] = array(
-    'name'           => t('Patch'),
-    'module'         => 'patch_manager',
-    'description'    => t('A <em>patch</em> is used by developers to store a patch file, and keep track of information related to that patch.'),
-    'title_label'    => t('Patch name'),
-    'has_body'       => 1,
-    'body_label'     => t('Patch notes'),
-    'locked'         => 0,
+    'name' => t('Patch'),
+    'base' => 'patch_manager',
+    'description' => t('A <em>patch</em> is used by developers to store a patch file, and keep track of information related to that patch.'),
+    'title_label' => t('Patch name'),
+    'has_body' => 1,
+    'body_label' => t('Patch notes'),
+    'locked' => 0,
   );
 
   return $items;
 }
 
-
 /**
- * Implementation of hook_nodeapi().
+ * Implements hook_node_view().
  */
-function patch_manager_nodeapi(&$node, $op, $teaser) {
-  switch ($op) {
-    case 'view':
-      if ($node->type === 'patch' && user_access('administer patch manager')) {
-        $form = drupal_get_form('patch_manager_node_actions_form', $node);
-        $node->content['patch_manager'] = array(
-          '#value' => $form,
-        );
-      }
+function patch_manager_node_view($node, $view_mode = 'full') {
+  if ($node->type === 'patch' && user_access('administer patch manager')) {
+    $form = drupal_get_form('patch_manager_node_actions_form', $node);
+    $node->content['patch_manager'] = array(
+      '#value' => $form,
+    );
   }
 }
 
-
 /**
- * Implementation of hook_action_info().
+ * Implements hook_action_info().
  */
 function patch_manager_action_info() {
   return array(
     'patch_manager_apply_action' => array(
-      'type'         => 'node',
-      'description'  => t('Apply patch'),
+      'type' => 'node',
+      'label' => t('Apply patch'),
       'configurable' => FALSE,
-      'hooks'        => array('any' => TRUE),
+      'triggers' => array('any' => TRUE),
     ),
     'patch_manager_revert_action' => array(
-      'type'         => 'node',
-      'description'  => t('Revert patch'),
+      'type' => 'node',
+      'label' => t('Revert patch'),
       'configurable' => FALSE,
-      'hooks'        => array('any' => TRUE),
-    ),
-  );
-}
-
-
-/**
- * Implementation of hook_theme().
- */
-function patch_manager_theme() {
-  return array(
-    'patch_manager_formatter_issuelink' => array(
-      'arguments' => array('element' => NULL),
+      'triggers' => array('any' => TRUE),
     ),
   );
 }
 
-
 /**
- * Implementation of hook_field_formatter_info().
+ * Implements hook_field_formatter_info().
  */
 function patch_manager_field_formatter_info() {
   $formats = array();
 
   $formats['issuelink'] = array(
-    'label'           => t('Issue link'),
-    'field types'     => array('text'),
-    'multiple values' => CONTENT_HANDLE_CORE,
+    'label' => t('Issue link'),
+    'field types' => array('text'),
+    'settings' => array(
+      'multiple values' => FIELD_BEHAVIOR_DEFAULT,
+    ),
   );
 
   return $formats;
@@ -221,25 +205,36 @@ function patch_manager_field_formatter_info() {
 
 
 /**
+ * Implements hook_field_formatter_view. 
+ */
+function patch_manager_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
+  $elements = array();
+  foreach ($items as $delta => $item) {
+    $elements[$delta] = array(
+      '#markup' => theme_patch_manager_issuelink($item['value']),
+    );
+  }
+  return $elements;
+}
+
+/**
  * Configuration form for patches
  */
-function patch_manager_settings_form() {
+function patch_manager_settings_form($form, &$form_state) {
   $form = array();
 
   $form['patch_manager_path_patch'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Patch binary path'),
-    '#description'   => t('Enter the full path to your systems patch binary.'),
+    '#type' => 'textfield',
+    '#title' => t('Patch binary path'),
+    '#description' => t('Enter the full path to your systems patch binary.'),
     '#default_value' => variable_get('patch_manager_path_patch', '/usr/bin/patch'),
-    '#validate'      => array('patch_manager_settings_form_validate'),
-    '#required'      => TRUE,
+    '#validate' => array('patch_manager_settings_form_validate'),
+    '#required' => TRUE,
   );
 
   return system_settings_form($form);
 }
 
-
-
 /**
  * Form submit handler
  */
@@ -250,29 +245,28 @@ function patch_manager_settings_form_validate($form, $form_state) {
   }
 }
 
-
 /**
  * Discover patches
  *
  * This is more for debugging than anything useful.
  */
 function patch_manager_page_scan() {
-  
+
   // Scan for patches
   $headers = array(
     t('Patch'),
     t('Path'),
   );
   $dir = dirname($_SERVER['SCRIPT_FILENAME']);
-  $mask = '.patch$|.diff$';
+  $mask = '/.patch$|.diff$/';
   $patches = file_scan_directory($dir, $mask);
   $rows = array();
   foreach ($patches as $patch) {
     $filename = str_replace("{$dir}/", '', $patch->filename);
-    $rows[] = array($patch->basename, l($filename, $filename));
+    $rows[] = array($patch->filename, l($filename, $filename));
   }
-  $output = theme('table', $headers, $rows);
-  
+  $output = theme('table', array('header' => $headers, 'rows' => $rows));
+
   // Registered patches
   $headers = array(
     t('Title'),
@@ -283,12 +277,11 @@ function patch_manager_page_scan() {
     t('Patchdir'),
   );
   $rows = patch_manager_list_patches();
-  $output .= theme('table', $headers, $rows);
-  
+  $output .= theme('table', array('header' => $headers, 'rows' => $rows));
+
   return $output;
 }
 
-
 /**
  * Render the list depending on what we have available (simple, or views_bulk_operations).
  */
@@ -306,7 +299,6 @@ function patch_manager_list() {
   return $view->preview($display_id);
 }
 
-
 /**
  * Get the list of patches.
  *
@@ -318,23 +310,22 @@ function patch_manager_list_patches() {
   return $list;
 }
 
-
 /**
  * Provide a form for nodes to perform simple actions
  */
-function patch_manager_node_actions_form($form_state, $node) {
+function patch_manager_node_actions_form($form, $form_state, $node) {
   $form = array();
 
   $form['#node'] = $node;
 
   $form['patch_manager_apply'] = array(
-    '#type'   => 'submit',
-    '#value'  => 'Apply patch',
+    '#type' => 'submit',
+    '#value' => 'Apply patch',
     '#submit' => array('patch_manager_node_actions_form_apply_submit'),
   );
 
   $form['patch_manager_revert'] = array(
-    '#type'  => 'submit',
+    '#type' => 'submit',
     '#value' => 'Revert patch',
     '#submit' => array('patch_manager_node_actions_form_reverse_submit'),
   );
@@ -342,7 +333,6 @@ function patch_manager_node_actions_form($form_state, $node) {
   return $form;
 }
 
-
 /**
  * Reverse the patch in a node view context
  *
@@ -353,12 +343,12 @@ function patch_manager_node_actions_form_reverse_submit($form, $form_state) {
 
   if ($result->status === PATCH_MANAGER_SUCCESS) {
     drupal_set_message(t('All parts of the patch were successfully reverted.'));
-  } else {
+  }
+  else {
     _patch_manager_display_errors($result);
   }
 }
 
-
 /**
  * Apply the patch in a node view context
  *
@@ -369,20 +359,22 @@ function patch_manager_node_actions_form_apply_submit($form, $form_state) {
 
   if ($result->status === PATCH_MANAGER_SUCCESS) {
     drupal_set_message(t('All parts of the patch were applied successfully.'));
-  } else {
+  }
+  else {
     _patch_manager_display_errors($result);
   }
 }
 
-
 /**
  * Run a patch operation
+ * 
+ * @todo Get field value by appropriate way.
  */
 function patch_manager_runpatch($node, $flags = '') {
-
   // Pull the values from the node
-  $patchfile = $node->field_patch[0]['filepath'];
-  $module    = $node->field_module[0]['value'];
+  // TODO Get field value by appropriate way.
+  $patchfile = $node->field_patch['und'][0]['uri'];
+  $module    = $node->field_module['und'][0]['value'];
 
   // Get the path from which to apply this patch
   // We start with the path to drupal core, then if it's a contrib module
@@ -391,15 +383,14 @@ function patch_manager_runpatch($node, $flags = '') {
   $root = dirname($_SERVER['SCRIPT_FILENAME']);
   if ($module !== 'core') {
     if ($modulepath = drupal_get_path('module', $module)) {
-      $root = $modulepath;
-    } else {
+      $root = realpath($modulepath);
+    }
+    else {
       drupal_set_message(t('Unable to find the specified module ... trying anyway.'), 'warning');
     }
   }
-
   // Give the patchfile an absolute path
-  $patchfile = realpath($patchfile);
-
+  $patchfile = drupal_realpath($patchfile);
   // Run the command
   $patch = variable_get('patch_manager_path_patch', '/usr/bin/patch');
   foreach (array('-p1', '-p0') as $pn) {
@@ -411,10 +402,11 @@ function patch_manager_runpatch($node, $flags = '') {
       escapeshellarg($patchfile)
     );
     exec($cmd, $output, $ret);
-    if ($ret < 2) break; // ret = 0: success, ret = 1: partial apply
+    if ($ret < 2) {
+      break; // ret = 0: success, ret = 1: partial apply
+    }
   }
   watchdog('patch_manager', 'Ran shell command (%command) which finished with status @status', array('%command' => $cmd, '@status' => $ret));
-
   // Return the results
   $status = new stdClass;
   $status->cmd    = $cmd;
@@ -424,7 +416,6 @@ function patch_manager_runpatch($node, $flags = '') {
   return $status;
 }
 
-
 /**
  * Patch apply action
  *
@@ -435,12 +426,12 @@ function patch_manager_apply_action(&$object, $context = array()) {
 
   if ($result->status === PATCH_MANAGER_SUCCESS) {
     drupal_set_message(t('Patch (@title) was applied successfully', array('@title' => $object->title)));
-  } else {
+  }
+  else {
     _patch_manager_display_errors($result);
   }
 }
 
-
 /**
  * Patch revert action
  *
@@ -448,15 +439,14 @@ function patch_manager_apply_action(&$object, $context = array()) {
  */
 function patch_manager_revert_action(&$object, $context = array()) {
   $result = patch_manager_runpatch($object, '-R');
-
   if ($result->status === PATCH_MANAGER_SUCCESS) {
     drupal_set_message(t('Patch (@title) was reversed successfully', array('@title' => $object->title)));
-  } else {
+  }
+  else {
     _patch_manager_display_errors($result);
   }
 }
 
-
 /**
  * Check status of the patch binary
  */
@@ -464,11 +454,9 @@ function _patch_manager_status($path) {
   if (!$path) {
     $path = variable_get('patch_manager_path_patch', '/usr/bin/patch');
   }
-
   if (file_exists($path) && is_executable($path)) {
     return TRUE;
   }
-
   return FALSE;
 }
 
@@ -482,22 +470,19 @@ function _patch_manager_display_errors($result) {
   drupal_set_message(t('This was the output from patch: <pre>@output</pre>', array('@output' => implode("\n", $result->output))));
 }
 
-
 /**
  * Theme an issue link
  */
-function theme_patch_manager_formatter_issuelink($element) {
-  $nid = $value = $element['#item']['value'];
+function theme_patch_manager_issuelink($item) {
+  $nid = $item;
   if (!$nid) {
     return NULL;
   }
-
   // Parse out the comment ID
   if (strpos($nid, '/') !== FALSE) {
-    list ($nid, $comment) = explode('/', $nid);
+    list($nid, $comment) = explode('/', $nid);
   }
-
   // Display
-  return l($value, 'http://drupal.org/node/' . $nid);
+  return l($nid, 'http://drupal.org/node/' . $nid);
 }
 
diff --git a/patch_manager.views_default.inc b/patch_manager.views_default.inc
index 065df20..bde8d7f 100644
--- a/patch_manager.views_default.inc
+++ b/patch_manager.views_default.inc
@@ -1,425 +1,415 @@
 <?php
 /**
- * @file patch_manager.views_default.inc
+ * @file
  * Provide default views to be used with the patch manager
  */
 
 /**
- * Implementation of hook_views_default_views().
+ * Implements hook_views_default_views().
  */
 function patch_manager_views_default_views() {
   $views = array();
-    
-  $view = new view;
+
+  $view = new view();
   $view->name = 'patches';
   $view->description = 'View patches stored with the patch manager.';
-  $view->tag = '';
-  $view->view_php = '';
+  $view->tag = 'dev';
   $view->base_table = 'node';
-  $view->is_cacheable = FALSE;
-  $view->api_version = 2;
-  $view->disabled = FALSE;
+  $view->human_name = '';
+  $view->core = 0;
+  $view->api_version = '3.0';
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
+  $handler->display->display_options['title'] = 'Patches';
+  $handler->display->display_options['use_more_text'] = 'more';
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['access']['perm'] = 'administer patch manager';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['exposed_form']['options']['reset_button_label'] = 'Reset';
+  $handler->display->display_options['exposed_form']['options']['exposed_sorts_label'] = 'Sort by';
+  $handler->display->display_options['exposed_form']['options']['sort_asc_label'] = 'Asc';
+  $handler->display->display_options['exposed_form']['options']['sort_desc_label'] = 'Desc';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['expose']['items_per_page_label'] = 'Items per page';
+  $handler->display->display_options['pager']['options']['expose']['items_per_page_options_all_label'] = '- All -';
+  $handler->display->display_options['pager']['options']['expose']['offset_label'] = 'Offset';
+  $handler->display->display_options['pager']['options']['tags']['first'] = '« first';
+  $handler->display->display_options['pager']['options']['tags']['previous'] = '‹ prev';
+  $handler->display->display_options['pager']['options']['tags']['next'] = 'next ›';
+  $handler->display->display_options['pager']['options']['tags']['last'] = 'last »';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['grouping'] = '';
+  $handler->display->display_options['style_options']['columns'] = array(
+    'nid' => 'nid',
+    'created' => 'created',
+    'field_module_value' => 'field_module_value',
+    'title' => 'title',
+    'field_drupal_issue_value' => 'field_drupal_issue_value',
+    'field_patch_fid' => 'field_patch_fid',
+  );
+  $handler->display->display_options['style_options']['default'] = 'field_module_value';
+  $handler->display->display_options['style_options']['info'] = array(
     'nid' => array(
-      'label' => '',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'link_to_node' => 0,
-      'exclude' => 1,
-      'id' => 'nid',
-      'table' => 'node',
-      'field' => 'nid',
-      'relationship' => 'none',
+      'sortable' => 0,
+      'separator' => '',
     ),
     'created' => array(
-      'label' => 'Created',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'date_format' => 'custom',
-      'custom_date_format' => 'Y-m-d',
-      'exclude' => 0,
-      'id' => 'created',
-      'table' => 'node',
-      'field' => 'created',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     'field_module_value' => array(
-      'label' => 'Module',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 0,
-        'ellipsis' => 0,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'link_to_node' => 0,
-      'label_type' => 'widget',
-      'format' => 'default',
-      'multiple' => array(
-        'group' => TRUE,
-        'multiple_number' => '',
-        'multiple_from' => '',
-        'multiple_reversed' => FALSE,
-      ),
-      'exclude' => 0,
-      'id' => 'field_module_value',
-      'table' => 'node_data_field_module',
-      'field' => 'field_module_value',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     'title' => array(
-      'label' => 'Name',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'link_to_node' => 1,
-      'exclude' => 0,
-      'id' => 'title',
-      'table' => 'node',
-      'field' => 'title',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     'field_drupal_issue_value' => array(
-      'label' => 'Issue #',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '<em>N/A</em>',
-      'hide_empty' => 1,
-      'empty_zero' => 0,
-      'link_to_node' => 0,
-      'label_type' => 'custom',
-      'format' => 'issuelink',
-      'multiple' => array(
-        'group' => TRUE,
-        'multiple_number' => '',
-        'multiple_from' => '',
-        'multiple_reversed' => FALSE,
-      ),
-      'exclude' => 0,
-      'id' => 'field_drupal_issue_value',
-      'table' => 'node_data_field_drupal_issue',
-      'field' => 'field_drupal_issue_value',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
+      'sortable' => 0,
+      'separator' => '',
     ),
     'field_patch_fid' => array(
-      'label' => 'Patch file',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 0,
-        'ellipsis' => 0,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'link_to_node' => 1,
-      'label_type' => 'widget',
-      'format' => 'default',
-      'multiple' => array(
-        'group' => TRUE,
-        'multiple_number' => '',
-        'multiple_from' => '',
-        'multiple_reversed' => FALSE,
-      ),
-      'exclude' => 0,
-      'id' => 'field_patch_fid',
-      'table' => 'node_data_field_patch',
-      'field' => 'field_patch_fid',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
+      'separator' => '',
     ),
-  ));
-  $handler->override_option('sorts', array(
-    'last_updated' => array(
-      'order' => 'ASC',
-      'granularity' => 'second',
-      'id' => 'last_updated',
-      'table' => 'node_comment_statistics',
-      'field' => 'last_updated',
-      'relationship' => 'none',
+  );
+  /* Field: Content: Nid */
+  $handler->display->display_options['fields']['nid']['id'] = 'nid';
+  $handler->display->display_options['fields']['nid']['table'] = 'node';
+  $handler->display->display_options['fields']['nid']['field'] = 'nid';
+  $handler->display->display_options['fields']['nid']['label'] = '';
+  $handler->display->display_options['fields']['nid']['exclude'] = TRUE;
+  /* Field: Content: Publish date */
+  $handler->display->display_options['fields']['created']['id'] = 'created';
+  $handler->display->display_options['fields']['created']['table'] = 'node';
+  $handler->display->display_options['fields']['created']['field'] = 'created';
+  $handler->display->display_options['fields']['created']['label'] = 'Created';
+  $handler->display->display_options['fields']['created']['date_format'] = 'custom';
+  $handler->display->display_options['fields']['created']['custom_date_format'] = 'Y-m-d';
+  /* Field: Content: Title */
+  $handler->display->display_options['fields']['title']['id'] = 'title';
+  $handler->display->display_options['fields']['title']['table'] = 'node';
+  $handler->display->display_options['fields']['title']['field'] = 'title';
+  $handler->display->display_options['fields']['title']['label'] = 'Name';
+  /* Sort criteria: Content: Date of update/comment */
+  $handler->display->display_options['sorts']['last_updated']['id'] = 'last_updated';
+  $handler->display->display_options['sorts']['last_updated']['table'] = 'node_comment_statistics';
+  $handler->display->display_options['sorts']['last_updated']['field'] = 'last_updated';
+  /* Filter criteria: Content: Module (field_module) */
+  $handler->display->display_options['filters']['field_module_value']['id'] = 'field_module_value';
+  $handler->display->display_options['filters']['field_module_value']['table'] = 'field_data_field_module';
+  $handler->display->display_options['filters']['field_module_value']['field'] = 'field_module_value';
+  $handler->display->display_options['filters']['field_module_value']['operator'] = 'contains';
+  $handler->display->display_options['filters']['field_module_value']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['field_module_value']['expose']['operator_id'] = 'field_module_value_op';
+  $handler->display->display_options['filters']['field_module_value']['expose']['label'] = 'Module';
+  $handler->display->display_options['filters']['field_module_value']['expose']['operator'] = 'field_module_value_op';
+  $handler->display->display_options['filters']['field_module_value']['expose']['identifier'] = 'field_module_value';
+  /* Filter criteria: Content: Title */
+  $handler->display->display_options['filters']['title']['id'] = 'title';
+  $handler->display->display_options['filters']['title']['table'] = 'node';
+  $handler->display->display_options['filters']['title']['field'] = 'title';
+  $handler->display->display_options['filters']['title']['operator'] = 'contains';
+  $handler->display->display_options['filters']['title']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['title']['expose']['operator_id'] = 'title_op';
+  $handler->display->display_options['filters']['title']['expose']['label'] = 'Name';
+  $handler->display->display_options['filters']['title']['expose']['operator'] = 'title_op';
+  $handler->display->display_options['filters']['title']['expose']['identifier'] = 'title';
+  /* Filter criteria: Content: Type */
+  $handler->display->display_options['filters']['type']['id'] = 'type';
+  $handler->display->display_options['filters']['type']['table'] = 'node';
+  $handler->display->display_options['filters']['type']['field'] = 'type';
+  $handler->display->display_options['filters']['type']['value'] = array(
+    'patch' => 'patch',
+  );
+  $handler->display->display_options['filters']['type']['group'] = '0';
+  $handler->display->display_options['filters']['type']['expose']['label'] = 'Node: Type';
+  $handler->display->display_options['filters']['type']['expose']['operator'] = 'type_op';
+  $handler->display->display_options['filters']['type']['expose']['identifier'] = 'type';
+
+  /* Display: Bulk List */
+  $handler = $view->new_display('page', 'Bulk List', 'bulklist');
+  $handler->display->display_options['defaults']['style_plugin'] = FALSE;
+  $handler->display->display_options['empty']['text']['id'] = 'area';
+  $handler->display->display_options['empty']['text']['table'] = 'views';
+  $handler->display->display_options['empty']['text']['field'] = 'area';
+  $handler->display->display_options['empty']['text']['empty'] = FALSE;
+  $handler->display->display_options['empty']['text']['content'] = '<p>There are no patches being managed by the patch manager.</p>';
+  $handler->display->display_options['empty']['text']['format'] = '1';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['columns'] = array(
+    'nid' => 'nid',
+    'created' => 'created',
+    'title' => 'title',
+  );
+  $handler->display->display_options['style_options']['default'] = 'created';
+  $handler->display->display_options['style_options']['info'] = array(
+    'nid' => array(
+      'sortable' => 0,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
     ),
-  ));
-  $handler->override_option('filters', array(
-    'type' => array(
-      'operator' => 'in',
-      'value' => array(
-        'patch' => 'patch',
-      ),
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => 'type_op',
-        'label' => 'Node: Type',
-        'use_operator' => FALSE,
-        'identifier' => 'type',
-        'remember' => FALSE,
-        'single' => TRUE,
-        'optional' => TRUE,
-        'reduce' => FALSE,
-      ),
-      'id' => 'type',
-      'table' => 'node',
-      'field' => 'type',
-      'relationship' => 'none',
+    'views_bulk_operations' => array(
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
     ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'administer patch manager',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Patches');
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'columns' => array(
-      'nid' => 'nid',
-      'created' => 'created',
-      'field_module_value' => 'field_module_value',
-      'title' => 'title',
-      'field_drupal_issue_value' => 'field_drupal_issue_value',
-      'field_patch_fid' => 'field_patch_fid',
+    'field_module' => array(
+      'sortable' => 1,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
     ),
-    'info' => array(
-      'nid' => array(
-        'sortable' => 0,
-        'separator' => '',
-      ),
-      'created' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'field_module_value' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'title' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'field_drupal_issue_value' => array(
-        'sortable' => 0,
-        'separator' => '',
-      ),
-      'field_patch_fid' => array(
-        'separator' => '',
-      ),
+    'field_drupal_issue' => array(
+      'sortable' => 1,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
     ),
-    'default' => 'field_module_value',
-  ));
-  $handler = $view->new_display('page', 'Simple List', 'simplelist');
-  $handler->override_option('empty', '<p>There are no patches being managed by the patch manager.</p>');
-  $handler->override_option('empty_format', '1');
-  $handler->override_option('path', 'admin/build/patch/simplelist');
-  $handler->override_option('menu', array(
-    'type' => 'none',
-    'title' => 'List',
-    'description' => 'List patches stored with the patch manager.',
-    'weight' => '0',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => 'Patches',
-    'description' => 'Patch management of core and contributed modules.',
-    'weight' => '0',
-    'name' => 'navigation',
-  ));
-  
-  // If we have views_bulk_operations enabled, then we add another view
-  if (module_exists('views_bulk_operations')) {
-    $handler = $view->new_display('page', 'Bulk List', 'bulklist');
-    $handler->override_option('style_plugin', 'bulk');
-    $handler->override_option('style_options', array(
-      'grouping' => '',
-      'override' => 1,
-      'sticky' => 0,
-      'order' => 'asc',
-      'columns' => array(
-        'nid' => 'nid',
-        'created' => 'created',
-        'field_module_value' => 'field_module_value',
-        'title' => 'title',
-        'field_drupal_issue_value' => 'field_drupal_issue_value',
-        'field_patch_fid' => 'field_patch_fid',
-      ),
-      'info' => array(
-        'nid' => array(
-          'sortable' => 1,
-          'separator' => '',
-        ),
-        'created' => array(
-          'sortable' => 1,
-          'separator' => '',
-        ),
-        'field_module_value' => array(
-          'sortable' => 1,
-          'separator' => '',
-        ),
-        'title' => array(
-          'sortable' => 1,
-          'separator' => '',
-        ),
-        'field_drupal_issue_value' => array(
-          'sortable' => 0,
-          'separator' => '',
-        ),
-        'field_patch_fid' => array(
-          'separator' => '',
+    'title' => array(
+      'sortable' => 1,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
+    ),
+    'created' => array(
+      'sortable' => 1,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
+    ),
+  );
+  $handler->display->display_options['style_options']['sticky'] = TRUE;
+  $handler->display->display_options['style_options']['empty_table'] = TRUE;
+  $handler->display->display_options['defaults']['style_options'] = FALSE;
+  $handler->display->display_options['defaults']['row_plugin'] = FALSE;
+  $handler->display->display_options['defaults']['row_options'] = FALSE;
+  $handler->display->display_options['defaults']['fields'] = FALSE;
+  /* Field: Content: Nid */
+  $handler->display->display_options['fields']['nid']['id'] = 'nid';
+  $handler->display->display_options['fields']['nid']['table'] = 'node';
+  $handler->display->display_options['fields']['nid']['field'] = 'nid';
+  $handler->display->display_options['fields']['nid']['label'] = '';
+  $handler->display->display_options['fields']['nid']['exclude'] = TRUE;
+  /* Field: Bulk operations: Content */
+  $handler->display->display_options['fields']['views_bulk_operations']['id'] = 'views_bulk_operations';
+  $handler->display->display_options['fields']['views_bulk_operations']['table'] = 'node';
+  $handler->display->display_options['fields']['views_bulk_operations']['field'] = 'views_bulk_operations';
+  $handler->display->display_options['fields']['views_bulk_operations']['label'] = '';
+  $handler->display->display_options['fields']['views_bulk_operations']['element_label_colon'] = FALSE;
+  $handler->display->display_options['fields']['views_bulk_operations']['hide_alter_empty'] = FALSE;
+  $handler->display->display_options['fields']['views_bulk_operations']['vbo']['entity_load_capacity'] = '10';
+  $handler->display->display_options['fields']['views_bulk_operations']['vbo']['operations'] = array(
+    'action::patch_manager_apply_action' => array(
+      'selected' => 1,
+      'use_queue' => 0,
+      'skip_confirmation' => 1,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::views_bulk_operations_delete_item' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::views_bulk_operations_script_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::views_bulk_operations_modify_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+      'settings' => array(
+        'show_all_tokens' => 1,
+        'display_values' => array(
+          '_all_' => '_all_',
         ),
       ),
-      'default' => 'field_module_value',
-      'execution_type' => '1',
-      'display_type' => '1',
-      'hide_select_all' => 0,
+    ),
+    'action::views_bulk_operations_argument_selector_action' => array(
+      'selected' => 0,
       'skip_confirmation' => 0,
-      'display_result' => 0,
-      'merge_single_action' => 1,
-      'selected_operations' => array(
-        'patch_manager_apply_action' => 'patch_manager_apply_action',
-        'patch_manager_delete_action' => 'patch_manager_delete_action',
-        'patch_manager_revert_action' => 'patch_manager_revert_action',
-      ),
-      'views_bulk_operations_fields_action' => array(
-        'php_code' => 0,
-        'display_fields' => array(
-          'field_module' => 'field_module',
-          'field_patch' => 'field_patch',
-          'field_drupal_issue' => 'field_drupal_issue',
-        ),
+      'override_label' => 0,
+      'label' => '',
+      'settings' => array(
+        'url' => '',
       ),
-    ));
-    $handler->override_option('path', 'admin/build/patch/bulklist');
-    $handler->override_option('menu', array(
-      'type' => 'none',
-      'title' => '',
-      'description' => '',
-      'weight' => 0,
-      'name' => 'navigation',
-    ));
-    $handler->override_option('tab_options', array(
-      'type' => 'none',
-      'title' => '',
-      'description' => '',
-      'weight' => 0,
-      'name' => 'navigation',
-    ));
-  }
-  
-  $views['patches'] = $view;
-  
+    ),
+    'action::patch_manager_revert_action' => array(
+      'selected' => 1,
+      'use_queue' => 0,
+      'skip_confirmation' => 1,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::panelizer_set_status_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::node_promote_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::node_make_sticky_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::node_assign_owner_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::node_publish_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::node_make_unsticky_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::node_unpublish_by_keyword_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::system_send_email_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::system_goto_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::system_message_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::node_unpublish_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::node_save_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+    'action::node_unpromote_action' => array(
+      'selected' => 0,
+      'use_queue' => 0,
+      'skip_confirmation' => 0,
+      'override_label' => 0,
+      'label' => '',
+    ),
+  );
+  $handler->display->display_options['fields']['views_bulk_operations']['vbo']['enable_select_all_pages'] = 1;
+  $handler->display->display_options['fields']['views_bulk_operations']['vbo']['display_type'] = '0';
+  $handler->display->display_options['fields']['views_bulk_operations']['vbo']['display_result'] = 1;
+  $handler->display->display_options['fields']['views_bulk_operations']['vbo']['force_single'] = 0;
+  /* Field: Content: Module */
+  $handler->display->display_options['fields']['field_module']['id'] = 'field_module';
+  $handler->display->display_options['fields']['field_module']['table'] = 'field_data_field_module';
+  $handler->display->display_options['fields']['field_module']['field'] = 'field_module';
+  $handler->display->display_options['fields']['field_module']['label'] = 'Module';
+  $handler->display->display_options['fields']['field_module']['element_label_colon'] = FALSE;
+  /* Field: Content: Drupal.org issue number */
+  $handler->display->display_options['fields']['field_drupal_issue']['id'] = 'field_drupal_issue';
+  $handler->display->display_options['fields']['field_drupal_issue']['table'] = 'field_data_field_drupal_issue';
+  $handler->display->display_options['fields']['field_drupal_issue']['field'] = 'field_drupal_issue';
+  $handler->display->display_options['fields']['field_drupal_issue']['label'] = 'Issue #';
+  $handler->display->display_options['fields']['field_drupal_issue']['element_label_colon'] = FALSE;
+  $handler->display->display_options['fields']['field_drupal_issue']['type'] = 'issuelink';
+  /* Field: Content: Title */
+  $handler->display->display_options['fields']['title']['id'] = 'title';
+  $handler->display->display_options['fields']['title']['table'] = 'node';
+  $handler->display->display_options['fields']['title']['field'] = 'title';
+  $handler->display->display_options['fields']['title']['label'] = 'Name';
+  /* Field: Content: Publish date */
+  $handler->display->display_options['fields']['created']['id'] = 'created';
+  $handler->display->display_options['fields']['created']['table'] = 'node';
+  $handler->display->display_options['fields']['created']['field'] = 'created';
+  $handler->display->display_options['fields']['created']['label'] = 'Created';
+  $handler->display->display_options['fields']['created']['date_format'] = 'custom';
+  $handler->display->display_options['fields']['created']['custom_date_format'] = 'Y-m-d';
+  $handler->display->display_options['path'] = 'admin/structure/patch/bulklist';
+  $translatables['patches'] = array(
+    t('Defaults'),
+    t('Patches'),
+    t('more'),
+    t('Apply'),
+    t('Reset'),
+    t('Sort by'),
+    t('Asc'),
+    t('Desc'),
+    t('Items per page'),
+    t('- All -'),
+    t('Offset'),
+    t('« first'),
+    t('‹ prev'),
+    t('next ›'),
+    t('last »'),
+    t('Created'),
+    t('Name'),
+    t('Node: Type'),
+    t('Simple List'),
+    t('<p>There are no patches being managed by the patch manager.</p>'),
+    t('Bulk List'),
+    t('Module'),
+    t('Issue #'),
+  );
+
+  $views[$view->name] = $view;
+
   return $views;
 }
 
