Hi,
I had happened to install coder module in Drupal 7 and found some Coding standard Errors in Drupal Core modules and i am very much suprised. Can anyone explain how it can happen because Drupal allows us to Contribute a module only if it meets the standard but some of its own core is not of standard as per the coder module. I will give you some examples which i got
authorize.php
severity: normal
Line 44: The $title argument to drupal_set_title() should be enclosed within t() so that it is translatable.
drupal_set_title('Access denied');
update.php
severity: normal
Line 34: The $title argument to drupal_set_title() should be enclosed within t() so that it is translatable.
drupal_set_title('Drupal database update');
severity: critical
Line 66: Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use check_plain(),
filter_xss() or similar to ensure your $variable is fully sanitized.
'#title' => $module . ' module',
includes/filetransfer/filetransfer.inc
filetransfer.inc
severity: normal
Line -1: @file block missing (Drupal Docs)
modules/poll/poll.module
poll.module
severity: critical
Line 397: Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use check_plain(),
filter_xss() or similar to ensure your $variable is fully sanitized.
'#title' => $value !== '' ? t('Choice label') : t('New choice label'),
user.module
severity: critical
Line 1084: Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.
'#description' => $current_pass_description,
severity: critical
Line 1122: Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.
'#title' => $roles[DRUPAL_AUTHENTICATED_RID],
Thank you,
regards,
Anthony Adaikalaraj.A
Comments
You can commit modules that
You can commit modules that do not follow Drupal coding standards (I have). And you can also submit patches to Drupal core if you find issues like the ones you found.
Contact me to contract me for D7 -> D10/11 migrations.