Converting 6.x modules to 7.x - Categorical

Last updated on
15 October 2016

This documentation is deprecated. Recommend a change or new documentation.

NOTE: This page is NOT UP-TO-DATE and is NOT BEING UPDATED.. The main page and links referenced there are the authority. Sorry for any inconvenience....

Status Values

The Coder project provides two modules — Coder Review and Coder Upgrade — that can help automate the process of converting your modules from D6 to D7. The icons shown here indicate the current status of Coder Review and Coder Upgrade support for each of the conversion changes listed below.

Review Upgrade Description
Yes A Coder Review rule exists for this item
No A Coder Review rule needs to be written to locate the change
NC A Coder Review rule is not needed for this item (e.g. optional change)
Yes A Coder Upgrade routine exists for this item
No A Coder Upgrade routine needs to be written to make the change
NC A Coder Upgrade routine is not needed (e.g. optional change)
Unclear It is unclear if a review or upgrade is possible
N/A The change was reverted and no longer applies

Conversion changes by category

Review Upgrade Description
Module Info / Install
Yes Yes Module .info files must now specify all loadable code files explicitly
No Yes Update functions in .install files must include a Doxygen style comment
No Yes Add Doxygen @file tag to all install files
Yes No Module .info files can now optionally specify the version number of the module it depends on
Yes No .module file available during install
No No Update hooks now return strings or throw exceptions, and update_sql() is no more
No Yes Info file should specify core = 7.x (This is not listed on the chronological page.)
No No New update dependency system, affecting the order in which module updates are run
No No Module .info files can have configure line
No Yes Database schema (un)installed automatically
Yes Yes Schema descriptions are no longer translated
Yes Yes Schema descriptions are now plain text instead of HTML
Yes Yes Use absolute path (constructed from DRUPAL_ROOT) when including a file
Yes Yes Module .info files must now specify all loadable code files explicitly
N/A N/A drupal_set_session() replaces $_SESSION [NEEDS UPDATE]
Yes NC Default parameter when getting variables
Yes Yes Use defined constant REQUEST_TIME instead of time()
Yes Yes Rebuild functions have changed names
Yes NC New hooks: hook_modules_installed, hook_modules_enabled, hook_modules_disabled, and hook_modules_uninstalled
Yes Yes drupal_uninstall_module() is now drupal_uninstall_modules()
Yes Yes Use module_implements not module_list when calling hook implementations
Yes Yes Parameters for drupal_http_request() have changed
Yes Yes Moved statistics settings from admin/reports/settings to admin/settings/statistics admin/config/system/statistics and added a new 'administer statistics' permission
Yes Yes Renamed module_rebuild_cache() to system_rebuild_module_data(), renamed system_theme_data() to system_rebuild_theme_data(), and added system_get_info()
Yes No Standardized API for static variables and resetting them
Yes Yes The function drupal_set_html_head() has been renamed to drupal_add_html_head()
Yes Yes drupal_eval() renamed to php_eval
Yes Yes Changes to HTTP header functions [UPDATED]
Yes Yes Renamed drupal_set_content() and drupal_get_content()
Yes No Alternative cache implementations changed
Yes Yes Added drupal_set_time_limit()
Yes NC New tar archive library added
No No API for modules providing search has changed
No No User 1 is now called site maintenance account
No No drupal_alter() now takes at most 3 parameters by reference
No Yes drupal_set_header() and drupal_get_header() renamed to drupal_add_http_header() and drupal_get_http_header()
No No New hook_hook_info() added
No No Functions called very often that need a drupal_static() variable can use an optimized way of calling that function
No No All e-mails are considered to originate as HTML
No No hook_update_index() only runs when searching enabled for a given module
Yes Yes drupal_urlencode() replaced by drupal_encode_path()
No No system_retrieve_file() API cleanup
No No New hook_module_implements_alter
Unclear Unclear Changes to how Drupal sends email
Permissions and Access
Yes Yes hook_perm() renamed to hook_permission()
Yes Yes Permissions have titles (required) and descriptions (optional)
Unclear NC "administer nodes" permission split into "administer nodes", "access content overview", and "bypass node access"
No NC Moved statistics settings from admin/reports/settings to admin/settings/statistics admin/config/system/statistics and added a new 'administer statistics' permission
No NC Permissions are no longer sorted alphabetically
Yes No New permission tables
Yes No Node access hooks now have drupal_alter() functions
Yes Yes "use PHP for settings" permission should be used for all PHP settings rights (replaces "use PHP for block visibility")
N/A N/A Hide empty menu categories with access callback (REVERTED)
Unclear Yes hook_node_access_records() now applies to unpublished nodes; 'view own unpublished content' permission added
No Yes hook_access() removed in favor of hook_node_access()
No No Added API functions for creating, loading, updating, and deleting user roles and permissions
No No New 'restrict access' parameter in hook_permission() for labeling unsafe permissions
No No A completely new database API has been added
Yes Yes Schema descriptions are no longer translated
Yes No db_rewrite_sql() replaced with hook_query_alter()
Yes Yes Schema descriptions are now plain text instead of HTML
Yes No Do not use SELECT COUNT(*) to check for existence of rows in a table
No No Foreign keys added to core database table schema
N/A N/A Schema API now supports date and time types natively (REVERTED)
No Yes Database schema (un)installed automatically
No Yes The $ret parameter has been removed from all Schema operations
No Yes Block tables renamed
No Yes Block deltas are now specified as strings
No No New pattern for cross-database, performant, case-insensitive comparisons
No No Remove moderate column from node_schema()
No Yes db_result() has been removed; use ->fetchField() instead (This is not listed on the chronological page.)
No Yes Rename db_column_exists() to db_field_exists() (This is not listed on the chronological page.)
No Yes db_is_active() has been removed
Unclear Unclear Database prefixes are now per-connection
Unclear Unclear Node, filter and comment modules tables renamed to singular
Unclear Unclear The datetime field type has been removed in favour of database engine specific types
Unclear Unclear Database driver prefix handling has changed
N/A N/A The hook_menu() and hook_theme() "file" and "file path" keys have been removed (REVERTED)
Unclear No Menu "page callbacks" and blocks should return an array and hook_page_alter() (Render arrays discussion) [UPDATED]
Yes Yes _comment_load() is now comment_load()
Yes Yes Changed hook_menu_link_alter() (removed the $menu parameter)
Yes No Added a new top-level 'international' admin menu item
N/A N/A Hide empty menu categories with access callback (REVERTED)
No Yes Many paths to admin screens have changed
Yes Yes CRUD hooks for menu links: hook_menu_link_insert(), hook_menu_link_update(), hook_menu_link_delete()
No No Custom menu API
No Yes Changed Clean URLs and Search settings page path
No Yes Function menu_tree_data() now expects an array of links instead of a query results
No No menu_default_node_menu replaced with per-content type settings
Unclear Unclear MENU_CALLBACK meaning has changed for breadcrumbs, and some other menu API changes
Yes No Block module now optional
Yes Yes hook_nodeapi, hook_node_type, hook_user, and hook_block removed and replaced with families of related functions
No No Added hook_block_info_alter()
No Yes Block tables renamed
No Yes Block deltas are now specified as strings
No Yes "Boxes" have been renamed to "custom blocks"
Unclear Unclear New 'properties' element of block information
Yes Yes _comment_load() is now comment_load()
Yes No Comment status values in the database have flipped so they match node status
Yes NC comment_save() now supports programmatic saving
Yes Yes comment_validate() has been removed
Yes Yes comment_node_url() has been removed
Yes No Added comment_load_multiple() and hook_comment_load()
Yes No New hook_comment_presave() for comments
No No Comment.timestamp split into 'created' and 'changed'
No Yes hook_comment removed and replaced with family of related functions (This is not listed on the chronological page.)
No No Comment rendering overhaul
Unclear Unclear 'comment_form' form ID changed to 'comment_node_TYPE_form'
Unclear Unclear 'post comments without approval' permission name changed
Input Sanitization and Input Formats
Yes Yes Parameters to check_markup() have changed
Yes Yes drupal_set_title() uses check_plain() by default
Yes Yes hook_filter() and hook_filter_tips() replaced by hook_filter_info()
Yes No New #type 'text_format' for text format-enabled form elements
Yes Yes Moved filter module administrative URLs from admin/settings/filters/* to admin/settings/filter/*
No No Default text formats have been revamped
No No Text formats access is now controlled by permissions, and filter_access() parameters have changed
No Yes The parameters to filter_formats() have changed
Unclear Unclear Filter table updates
Unclear Unclear Text formats (input formats) must be defined
Unclear Unclear Text format (input format) identifier is now a machine name
Yes Yes taxonomy_get_tree()
Yes Yes Taxonomy db table names have changed to begin with 'taxonomy_'
Yes Yes taxonomy_term_load() and taxonomy_term_load_multiple()
Yes Yes Taxonomy CRUD functions renamed and refactored
Yes Yes New taxonomy hooks for term and vocabulary
Yes Yes Added taxonomy_vocabulary_load_multiple()
Yes No Removed taxonomy module support for multiple tids and depth in term paths
Yes No Related terms functionality was removed from taxonomy.module
No No All taxonomy functions relating to nodes have been removed or refactored
No Yes taxonomy_form_all() removed
No No taxonomy_term_view() and taxonomy-term.tpl.php for term display
No Yes Taxonomy synonyms have been removed
Yes No Changed Drupal.behaviors to objects having the methods 'attach' and 'detach'
Yes No Ability to reset JavaScript and CSS
Yes Yes Changed parameters for drupal_add_js() and drupal_add_css()
Yes Yes Replace 'core', 'module' and 'theme' with 'file' in drupal_add_js()
Yes No New hook_js_alter to alter JavaScript
Yes No JavaScript should be compatible with other libraries than jQuery
Yes Yes External JavaScript can now be referenced through drupal_add_js()
Yes No Settings passed locally to JavaScript Behaviors
Yes No jQuery 1.3.x
Yes No Attached JavaScript and CSS for forms
Yes No Ability to add multiple JavaScript/CSS files at once
Yes Yes jQuery UI (1.7) was added into core
Yes No JavaScript variable Drupal.jsEnabled has been removed
No No jQuery Once method for applying JavaScript behaviors once
No Yes Rename drupal_to_js() and drupal_json() to drupal_json_encode() and drupal_json_output()
No No Drupal.parseJSON has been removed and replaced with jQuery.parseJSON.
Unclear Unclear Javascript and CSS loading changes
Yes Yes Changed parameters for drupal_add_js() and drupal_add_css()
Yes No Attached JavaScript and CSS for forms
Yes Yes Inline cascading stylesheets from drupal_add_css()
Yes No Ability to add multiple JavaScript/CSS files at once
Yes NC drupal_add_css() now supports external CSS files
No Yes Weighting of stylesheets
No No Convert class attributes to array in favor of a string
No Yes form_clean_id() has been renamed to drupal_clean_css_identifier()
Unclear Unclear Javascript and CSS loading changes
Yes Yes Rebuild functions have changed names
Yes Yes Instead of theme('page', ...), think of drupal_set_page_content()
Yes No hook_footer() was removed, $closure became $page_bottom, $page_top added
Unclear No Element #type property no longer treated as a theme function in drupal_render()
Unclear Yes Use drupal_render_children() to render an element's children
Unclear No theme_links() has a new parameter $heading for accessibility
No Yes theme() now takes only two arguments
No Yes hook_theme() requires "variables" or "render element" instead of "arguments" to better integrate with drupal_render() [UPDATED]
No No New method for altering the theme used to display a page (global $custom_theme variable removed)
No Yes theme('placeholder') replaced by drupal_placeholder()
No No A theme hook name followed by a double underscore ('__') is a default 'pattern'
No No Preprocess functions need to now specify "theme_hook_suggestion(s)" instead of "template_file(s)"
No No Use #theme='links__MODULE' or #theme='links__MODULE_EXTRA_CONTEXT' when adding links to a render array
No Yes theme_pager() no longer takes limit parameter
No Yes theme_username() parameters changed
Unclear Unclear theme('box') no longer exists
Form API
No No #theme recommended for specifying theme function
Yes Yes Easier check for node form during hook_form_alter()
Yes No Some #process functions have been renamed
No No Use '#markup' not '#value' for markup
Yes Yes drupal_execute() renamed to drupal_form_submit()
No No drupal_get_form() returns a render array instead of a string [UPDATED]
Yes No AHAH/AJAX Processing has changed; #ajax, new 'callback' member of the array, and the callback must be rewritten
No Yes The signature of the callback from drupal_get_form() changed to add $form
No No Use #type='link' for adding a single link to a render array, particularly for tables that include operation links like 'edit', 'delete', etc.
No No Added entity_prepare_view() and hook_entity_prepare_view()
Yes No Attached JavaScript and CSS for forms
No Yes hook_elements() renamed to hook_element_info()
No Yes Removal of FAPI $form['#redirect'] and $_REQUEST['destination']
No No Form submit buttons consistently grouped in actions array
Unclear Unclear HTML rendering of form elements has different CSS classes
Unclear Unclear Form element value callbacks now always have $form_state argument
Unclear Unclear Forms are no longer automatically rebuilt when $form_state['storage'] is set
Unclear Unclear form_clean_id() has been renamed to drupal_html_id()
Unclear Unclear hook_form_alter and hook_form_FORM_ID_alter run together for each module
Unclear Unclear hook_form_BASE_FORM_ID_alter() is invoked for shared form constructors
Unclear Unclear $element['#post'] is gone
Unclear Unclear $form_state['clicked_button'] is deprecated, use $form_state['triggering_element'] instead
File API
Unclear No File operations that don't affect the database have been renamed
Unclear No User pictures are now managed files
Yes No file_load_multiple()
Yes Yes file_scan_directory()'s optional parameters are now an array
Yes Yes file_scan_directory() now uses a preg regular expression for the nomask parameter
Yes Yes Removed file_set_status()
Unclear No file_validate_extensions() enforces check for uid=1
Yes Yes file_scan_directory() and drupal_system_listing() use preg regular expressions
Unclear Yes file_scan_directory() now uses same property names as file_load()
Yes No file_check_directory() will now recursively create directories
No Yes file_check_directory() renamed to file_prepare_directory()
No No New hook: hook_file_url_alter()
Unclear Unclear Rename file to file_managed
Unclear Unclear file_directory_path() has been removed
User API
Yes Yes New user_cancel API
Yes Yes Changed log out path from 'logout' to 'user/logout' for consistency
Yes Yes hook_nodeapi, hook_node_type, hook_user, and hook_block removed and replaced with families of related functions
Yes No Save new users and nodes with specified IDs
Yes Yes user_load_multiple() and hook_user_load(), user_load() signature change, and $reset parameter
Yes Yes Parameters to function user_authenticate() changed
Yes Yes Removed several unnecessary arguments to various hook_user_$op hooks and removed hook_profile_alter
No No New API function: format_username() and new hook: hook_username_alter()
No No hook_user_form(), hook_user_register() are gone
No No hook_user_validate() and hook_user_submit() are gone
No No hook_user_after_update() replaced by hook_user_update(), amended by hook_user_presave() for common operations
Unclear Unclear New constants for user registration settings, and the default has been changed to "Visitors, but administrator approval is required"
Unclear Unclear Arbitrary user data is harder to stash in the user object
Node API
Yes Yes Move node, taxonomy, and comment links into $node->content; Deprecate hook_link()
Yes Yes node_load() and node_load_multiple()
Yes Yes In hook_node_info() change 'module' back to 'base' and change 'node' to 'node_content'
Yes Yes hook_nodeapi, hook_node_type, hook_user, and hook_block removed and replaced with families of related functions
Yes Yes node_invoke_nodeapi() removed
Yes No Add node_delete_multiple()
Yes Yes Removed $op "rss item" from hook_nodeapi() in favor of 'rss' view mode [UPDATED]
Yes Yes node_get_types($op) replaced by node_type_get_$op()
Yes Yes $teaser parameter changed to $view_mode in node viewing functions and hooks, $node->build_mode property removed [UPDATED]
Yes No Save new users and nodes with specified IDs
Yes N/A Replace node_view() with node_build() (REVERTED)
Yes Yes hook_nodeapi_xxx() becomes hook_node_xxx()
No Yes hook_load() signature and return value change
Unclear Unclear Node Body and Teaser Changes
Unclear Unclear COMMENT_NODE_* constants have new names, but same values
Unclear Unclear Node body field now requires normal field API usage
Unclear Unclear node_load() and other entity loading cache behavior has changed
Yes Yes Added string context support to t() and format_plural(), changed parameters
No No Language neutral content now has an explicit language associated with it
No No New language negotiation API introduced
Unclear Unclear Translatable Fields
Unclear No Code documentation added to module.api.php
Unclear Yes Commenting style - use 'Implements hook_foo().' when documenting hooks
Yes Yes Parameters swapped in book_toc()
Yes No Make sticky tableheaders optional
Yes Yes referer_uri() has been removed
Yes Yes Replace drupal_clone() with clone
Yes Yes Parameters for actions_synchronize() have changed
Unclear Yes Trigger and Actions API overhaul
No No Login validation change for distributed authentication modules
No No Added hook_entity_load()
No No Drupal 7 requires PHP 5.2 or higher
N/A N/A xmlrpc() wrapper function removed (REVERTED)
No No Replaced taxonomy_term_path(), hook_term_path(), language_url_rewrite(), and custom_url_alter_outbound() with hook_url_outbound_alter()
No No Replaced custom_url_rewrite_inbound() with hook_url_inbound_alter()
No Yes Renamed menu_path_is_external() to url_is_external()
No No New entity_info_cache_clear() API function
Unclear No New hooks: hook_admin_paths() and hook_admin_paths_alter()
No Yes The function menu_valid_path() has been renamed to drupal_valid_path(), and its inputs have changed
No No Blog API module removed from Drupal core
No Yes drupal_goto() follows parameters of url()
No Yes Format date types "small" and "large" have been changed to "short" and "long"
No Yes url() 'query' field must be array
No No User-configured time zones now serve as the default time zone for PHP date/time functions
Unclear Unclear Two page caching functions renamed
Unclear Unclear MIME types list changed from variable to alter hook/function
Unclear Unclear Query string functions renamed
Unclear Unclear Arguments to xmlrpc() have changed
Unclear Unclear Two new functions added: hook_page_build() and hook_page_alter()
Unclear Unclear l() function class attribute