Skip to content
Snippets Groups Projects
Commit a1c9b1bc authored by Doug Green's avatar Doug Green
Browse files

add check in menu system based on DrupalCon talk by chx and pwolanin

parent 2cf63898
Branches
Tags 5.x-2.8
No related merge requests found
......@@ -2,7 +2,7 @@
// $Id$
if (module_exists('drush')) {
include_once(drupal_get_path('module', 'coder') .'/coder.drush.inc');
include(drupal_get_path('module', 'coder') .'/coder.drush.inc');
}
/**
......
......@@ -18,6 +18,12 @@ function coder_6x_reviews() {
'#value' => '\$items\[\]\s*=|if\s*\(\$may_cache\)',
'#warning_callback' => '_coder_6x_new_menu_system_warning',
),
array(
'#type' => 'regex',
'#function' => '_menu$',
'#value' => '(for|foreach|while)\s*\(',
'#warning_callback' => '_coder_6x_new_menu_loop_warning',
),
array(
'#type' => 'regex',
'#value' => '_form_alter\s*\(\$',
......@@ -535,6 +541,13 @@ function _coder_6x_new_menu_system_warning() {
);
}
function _coder_6x_new_menu_loop_warning() {
return array(
'#warning' => t('The menu system has been completely over-hauled in 6.x, and if you are looping, you are probably doing something wrong.'),
'#link' => 'http://drupal.org/node/103114',
);
}
function _coder_6x_form_alter_warning() {
return array(
'#warning' => t('!hook_form_alter() parameters have changed',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment