There are a lot of coding standards issues that should be fixed before the stable release.

Comments

nkoporec created an issue. See original summary.

nkoporec’s picture

Status: Active » Needs review
StatusFileSize
new52.56 KB
alan d.’s picture

If deleting chunks of old un-ported code, maybe create followup issues noting these.

This particular bit ensured that you couldn't set the length to be smaller than the shortest name component. Currently this isn't enforced, but probably should be:

-    // @todo: Port this feature to Drupal 8.
-    //    $extra_max_info = '<div>' . t('This can not be less than the longest value in the database. The minimum values are:') . '</div>';
-    //    $extra_max_items = [];
-    //    foreach (_name_translations() as $key => $title) {
-    //      $extra_max_items[] = t('@title is @size', [
-    //        '@title' => $title,
-    //        '@size' => $form['max_length'][$key]['#min'],
-    //      ]);
-    //    }
-    //    $item_list = [
-    //      '#theme' => 'item_list',
-    //      '#items' => $extra_max_items,
-    //    ];
-    //    $extra_max_info .= drupal_render($item_list);
-    //  if ($has_data) {
-    //  $min_length = $settings['max_length'][$key];
-    //    if ($field['storage']['type'] == 'field_sql_storage') {
-    //      try {
-    //        $table = 'field_data_' . $field['field_name'];
-    //        $column = $field['storage']['details']['sql'][FIELD_LOAD_CURRENT]
-    //        [$table][$key];
-    //        $min_length = db_query("SELECT MAX(CHAR_LENGTH({$column})) AS len FROM {$table}")->fetchField();
-    //        if ($min_length < 1) {
-    //          $min_length = 1;
-    //        }
-    //      }
-    //      catch (Exception $e) {
-    //      }
-    //    }
-    //}

These two commented out sections are no longer relevant :)

-      /*
-      t('@components can not be selected for @label when they are not selected for @label2.',
-              ['@label' => t('Minimum components'), '@label2' => t('Components'),
-              '@components' => Html::escape(implode(', ', [$n['title'], $n['generational'], $n['credentials']]))]),
-      */

Not sure on the status of this @todo

-    // TODO
     $type = ($key == 'title' || $key == 'generational') ? 'select' : 'textfield';

The file legacy/webform.components.inc that can be nuked / deleted. There is no overlap between Drupal 7 & 8 coding and if WebForm integration is done, it'll be best to start from scratch. After pushing this patch, you can delete or if I notice the commit, I can :)

Some of the line lengths seem a bit off in a number of places?

        // Generational suffixes may be also imported from
        // one or more vocabularies
        // using the tag '[vocabulary:xxx]',
        // where xxx is the vocabulary id.
        // Terms that exceed the maximum length of the generational
        // suffix are not added to the options list.

        // Generational suffixes may be also imported from one or more
        // vocabularies using the tag '[vocabulary:xxx]', where xxx is the
        // vocabulary id. Terms that exceed the maximum length of the
        // generational suffix are not added to the options list.

Space after dot. "flag is set. If set," is less verbose if you were trying to go from 81 to 80 chars

-   * flag is set. If this is set, it runs the component through check_plain() and
+   * flag is set.If this is set, it runs the component through check_plain() and

Maybe "Updates the link and alternative data sources formatter settings" rather than "sett." abbreviation.

- * Updates the field formatter settings for new link and alternative data sources settings.
+ * Updates the formatter sett. for new link and alternative data sources sett.

Maybe "Language manager for retrieving the langcode if required." rather than abbreviations, or "default langcode" if that fits.

-   * Language manager for retrieving the default langcode when none is specified.
+   * Language manager for retrieving the def. langcode when none is specified.

Preferred doesn't need the semicolon either I guess.

    *   - preferred (string):
-   *   - alternative (string):
+   *   - alternative (string)
alan d.’s picture

StatusFileSize
new46.22 KB

  • Alan D. committed 65ac429 on 8.x-1.x
    Issue #2971986 by nkoporec, Alan D.: Coding standards
    

  • Alan D. committed c70b7c5 on 8.x-1.x
    Issue #2971986 by nkoporec, Alan D.: Coding standards (followup)
    
alan d.’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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