Support from Acquia helps fund testing for Drupal Acquia logo

Comments

monika.kadam1206 created an issue. See original summary.

monika.kadam1206’s picture

I have resolved the 16 drupal coding standards issues for the module.

monika.kadam1206’s picture

Status: Active » Needs review
monika.kadam1206’s picture

Updated the patch for more Errors and warnings.

monika.kadam1206’s picture

Assigned: monika.kadam1206 » Unassigned
Sutharsan’s picture

Thanks for working on this. Have you use code sniffer to check the style?

  1. +++ b/l10n_update.module
    @@ -109,11 +109,13 @@ function l10n_update_help($path, $arg) {
    -      break;
    +
    +    break;
         case 'admin/config/regional/language/update':
    

    Is this according to coding standards? I doubt it.

  2. +++ b/l10n_update.module
    @@ -183,7 +185,7 @@ function l10n_update_menu_alter(&$menu) {
    - * Check one project/language at a time, download and import if update available
    + * Check one project/language at a time, download and import if update available.
    

    80+ chars

  3. +++ b/l10n_update.module
    @@ -291,10 +293,12 @@ function l10n_update_form_alter(&$form, $form_state, $form_id) {
           break;
    +
         case 'locale_languages_predefined_form':
    

    Agree, with the change. Previous case/break not consistent with this one.

  4. +++ b/l10n_update.module
    @@ -416,11 +418,23 @@ function l10n_update_client_save_string() {
    -      $lid = db_query("SELECT lid FROM {locales_source} WHERE source = :source AND context = :context AND textgroup = :textgroup", array(':source' => $_POST['source'], ':context' => '', ':textgroup' => $_POST['textgroup']))->fetchField();
    +      $lid = db_query("SELECT lid FROM {locales_source} WHERE source =
    +        :source AND context = :context AND textgroup = :textgroup",
    +        array(
    +          ':source' => $_POST['source'],
    +          ':context' => '',
    +          ':textgroup' =>
    +          $_POST['textgroup'],
    +        ))->fetchField();
     
    

    I don't like these line breaks, it does not support readability of the code.

  5. +++ b/l10n_update.module
    @@ -416,11 +418,23 @@ function l10n_update_client_save_string() {
    -        $report = array('skips' => 0, 'additions' => 0, 'updates' => 0, 'deletes' => 0);
    +        $report = array(
    +          'skips' => 0,
    +          'additions' => 0,
    +          'updates' =>
    +          0, 'deletes' => 0,
    +        );
             // @todo: add actual context support.
    

    reformat 'updates', and 'deletes'.

  6. +++ b/l10n_update.module
    @@ -447,7 +461,17 @@ function l10n_update_client_save_string() {
    +              t('You could share your work with !l10n_server ¶
    +                if you set your API key at !user_link.',
    +                  array(
    

    It is bad for translators to break-up t() string.
    Keep 'message' and 'level' at the same indention level, they are both arguments of the theme function.

  7. +++ b/l10n_update.module
    @@ -492,7 +516,8 @@ function l10n_update_system_update(array $components) {
    -      // Get translation status of the projects, download and update translations.
    +      // Get translation status of the projects,
    +      // download and update translations.
           $options = _l10n_update_default_update_options();
    

    Fill out the first line to a max, i.e. new line before "translations.".

  8. +++ b/l10n_update.module
    @@ -519,7 +544,8 @@ function l10n_update_system_remove($components) {
    -    // deleted. Not each disabled module will remove a project. E.g. sub modules.
    +    // deleted. Not each disabled module will remove a project.
    +    // E.g. sub modules.
         $projects = array_keys(l10n_update_get_projects());
    

    See above.

Sutharsan’s picture

Title: Drupal standards issue » Coding standards
Sutharsan’s picture

This patch contains #4 and many more code style errors and warnings (I used Code Sniffer, see Coder module 8.x branch). I skipped the code style errors that change the code, such as long arrays, camel case and underscore in variable names.

  • Sutharsan committed ac6e793 on 7.x-2.x
    Issue #2580829 by monika.kadam1206, Sutharsan: Coding standards
    
Sutharsan’s picture

Status: Needs review » Fixed

Before I allow code changing style fixes, the test scripts of Localization Update must be activated first.

monika.kadam1206’s picture

Yes I used code snipper to test drupal coding standards.
Still there where many errors 16 + errors so I corrected them leaving some array errors etc.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.