Converting 6.x modules to 7.x - Categorical

Last modified: December 8, 2009 - 14:58

Status Values

The review and upgrade statuses for the conversion changes refer to their status in the Coder Review and Coder Upgrade modules.

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

The statuses by category are as follows:

Review Upgrade Description
Module Info / Install
Unclear Code documentation added to module.api.php
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 No 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 No Info file should specify core = 7.x (This is not listed on the chronological page.)
System
Yes No 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
No Yes Moved statistics settings from admin/reports/settings to admin/settings/statistics admin/config/system/statistics and added a new 'administer statistics' permission
No 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
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
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
Database
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
No No Schema API now supports date and time types natively
No Yes Database schema (un)installed automatically
No Yes The $ret parameter has been removed from all Schema operations
Menu
N/A N/A The hook_menu() and hook_theme() "file" and "file path" keys have been removed
Unclear No Menu page callbacks and blocks should return an array and hook_page_alter()
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)
Unclear Unclear 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
Blocks
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()
Comments
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.)
Input Sanitization and Input Formats
Yes Yes Parameters to check_markup() have changed
Yes Yes drupal_set_title() uses check_plain() by default
Yes No hook_filter() and hook_filter_tips() replaced by hook_filter_info()
Yes No New #text_format property to assign text format selection to fields. Changes 'body' field location in node, comment, block, etc
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
Taxonomy
Yes Yes taxonomy_get_tree()
Yes No Taxonomy db table names have changed to begin with 'taxonomy_'
Yes No taxonomy_term_load() and taxonomy_term_load_multiple()
Yes Yes Taxonomy CRUD functions renamed and refactored
Yes No New taxonomy hooks for term and vocabulary
Yes No 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
Javascript
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 No 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 No 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()
CSS
Yes Yes Changed parameters for drupal_add_js() and drupal_add_css()
Yes No Attached JavaScript and CSS for forms
Yes No 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 No Weighting of stylesheets
No No Convert class attributes to array in favor of a string
Theming
Yes Yes Rebuild functions have changed names
Yes No 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 No 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 No hook_theme() requires that each theme function registers how it integrates with drupal_render()
Form API
No No #theme recommended for specifying theme function
Yes No 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 an unrendered array
Yes No AHAH/AJAX Processing has changed; #ajax, new 'callback' member of the array, and the callback must be rewritten
No No The signature of the callback from drupal_get_form() changed to add $form
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 No file_scan_directory()'s optional parameters are now an array
Yes No 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 No Removed FILE_STATUS_TEMPORARY
Yes Yes file_scan_directory() and drupal_system_listing() use preg regular expressions
Unclear No file_scan_directory() now uses same property names as file_load()
Yes No file_check_directory() will now recursively create directories
No No New hook: hook_file_url_alter()
User API
Yes Yes Renamed user_delete() to user_cancel(), likewise renamed hook_user_delete() to hook_user_cancel()
Yes No 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 No user_load_multiple() and hook_user_load()
Yes Yes Parameters to function user_authenticate() changed
Yes No Removed several unnecessary arguments to various hook_user_$op hooks and removed hook_profile_alter
Node API
Yes No Move node, taxonomy, and comment links into $node->content; Deprecate hook_link()
Yes No node_load() and node_load_multiple()
Yes No 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 No node_invoke_nodeapi() removed
Yes No Add node_delete_multiple()
Yes Yes Removed $op "rss item" from hook_nodeapi() in favor of NODE_BUILD_RSS
Yes No node_get_types($op) replaced by node_type_get_$op()
Yes Yes $teaser parameter changed to $build_mode in node building functions and hooks, $node->build_mode property removed
Yes No Save new users and nodes with specified IDs
Yes No Replace node_view() with node_build()
Yes Yes hook_nodeapi_xxx() becomes hook_node_xxx()
No No hook_load() signature and return value change
Multi-lingual
Yes Yes Added string context support to t() and format_plural(), changed parameters
Miscellaneous
Unclear No Commenting style - use 'Implement 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 Unclear 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
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 Unclear New hooks: hook_admin_paths() and hook_admin_paths_alter()
 
 

Drupal is a registered trademark of Dries Buytaert.