diff --git a/core/modules/comment/comment.admin.inc b/core/modules/comment/comment.admin.inc index 89f3ae6..e5db355 100644 --- a/core/modules/comment/comment.admin.inc +++ b/core/modules/comment/comment.admin.inc @@ -119,7 +119,7 @@ function comment_admin_overview($form, &$form_state, $arg) { '#account' => comment_prepare_author($comment), ); $options[$comment->id()] = array( - 'title' => array('data' => array('#title' => $comment->subject->value)), + 'title' => array('data' => array('#title' => $comment->subject->value ?: $comment->id())), 'subject' => array( 'data' => array( '#type' => 'link', diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php b/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php index 1906abb..65331f1 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php @@ -17,12 +17,15 @@ public function buildForm(array $form, array &$form_state) { ); $form['import_tarball'] = array( '#type' => 'file', - '#value' => t('Select your configuration export file'), + '#title' => t('Select your configuration export file'), '#description' => t('This form will redirect you to the import configuration screen.'), ); - $form['submit'] = array( + + $form['actions']['#type'] = 'actions'; + $form['actions']['submit'] = array( '#type' => 'submit', '#value' => t('Upload'), + '#button_type' => 'primary', ); return $form; } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php index 6948642..a6801ff 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php @@ -155,6 +155,8 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac '#weight' => -100, '#multilingual' => TRUE, 'source' => array( + '#title' => t('Select source language'), + '#title_display' => 'invisible', '#type' => 'select', '#default_value' => $source_langcode, '#options' => array(), diff --git a/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/Editor/UnicornEditor.php b/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/Editor/UnicornEditor.php index d87a4e8..610a18f 100644 --- a/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/Editor/UnicornEditor.php +++ b/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/Editor/UnicornEditor.php @@ -34,7 +34,11 @@ function getDefaultSettings() { * Implements \Drupal\editor\Plugin\EditPluginInterface::settingsForm(). */ function settingsForm(array $form, array &$form_state, EditorEntity $editor) { - $form['foo'] = array('#type' => 'textfield', '#default_value' => 'bar'); + $form['foo'] = array( + '#title' => t('Foo'), + '#type' => 'textfield', + '#default_value' => 'bar', + ); return $form; } diff --git a/core/modules/language/tests/language_elements_test/language_elements_test.module b/core/modules/language/tests/language_elements_test/language_elements_test.module index 6030e4c..14d8927 100644 --- a/core/modules/language/tests/language_elements_test/language_elements_test.module +++ b/core/modules/language/tests/language_elements_test/language_elements_test.module @@ -54,6 +54,7 @@ function language_elements_configuration_element() { */ function language_elements_configuration_element_test() { $form['langcode'] = array( + '#title' => t('Language select'), '#type' => 'language_select', '#default_value' => language_get_default_langcode('custom_type', 'some_bundle'), ); diff --git a/core/modules/locale/css/locale.admin.css b/core/modules/locale/css/locale.admin.css index bae704d..b8c4fd5 100644 --- a/core/modules/locale/css/locale.admin.css +++ b/core/modules/locale/css/locale.admin.css @@ -85,9 +85,10 @@ background: transparent url(../../../misc/menu-expanded.png) left .6em no-repeat; } -#locale-translation-status-form label { +#locale-translation-status-form .label { color: #1d1d1d; font-size: 1.15em; + font-weight: bold; } #locale-translation-status-form .description { cursor: pointer; diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index 6326905..9b8ea10 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -5,6 +5,7 @@ * Interface translation summary, editing and deletion user interfaces. */ +use Drupal\Component\Utility\String; use Drupal\Core\Language\Language; use Drupal\locale\SourceString; use Drupal\locale\TranslationString; @@ -544,13 +545,16 @@ function locale_translation_status_form($form, &$form_state) { // Build data options for the select table. foreach($updates as $langcode => $update) { + $title = String::checkPlain($languages[$langcode]->name); $options[$langcode] = array( - 'title' => check_plain($languages[$langcode]->name), + 'title' => array('class' => array('label'), 'data' => array('#title' => $title, '#markup' => $title)), 'status' => array('class' => array('description', 'expand', 'priority-low'), 'data' => theme('locale_translation_update_info', $update)), ); } // Sort the table data on language name. - uasort($options, 'drupal_sort_title'); + uasort($options, function ($a, $b) { + return strcasecmp($a['title']['data']['#title'], $b['title']['data']['#title']); + }); } $last_checked = Drupal::state()->get('locale.translation_last_checked'); @@ -657,13 +661,6 @@ function locale_translation_status_form_submit($form, &$form_state) { * translation files could not be found. */ function locale_translation_language_table($form_element) { - // Add labels to Language names. - foreach ($form_element['#options'] as $langcode => $option) { - $id = $form_element[$langcode]['#id']; - $title = $option['title']; - $form_element['#options'][$langcode]['title'] = ''; - } - // Remove checkboxes of languages without updates. if ($form_element['#not_found']) { foreach ($form_element['#not_found'] as $langcode) { diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module index 80653da..67ae37c 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module +++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module @@ -520,6 +520,7 @@ function ajax_forms_test_validation_number_form_callback($form, $form_state) { */ function ajax_forms_test_lazy_load_form($form, &$form_state) { $form['add_files'] = array( + '#title' => t('Add files'), '#type' => 'checkbox', '#default_value' => FALSE, ); diff --git a/core/modules/system/tests/modules/batch_test/batch_test.module b/core/modules/system/tests/modules/batch_test/batch_test.module index 2c1bee2..7660c73 100644 --- a/core/modules/system/tests/modules/batch_test/batch_test.module +++ b/core/modules/system/tests/modules/batch_test/batch_test.module @@ -312,6 +312,7 @@ function _batch_test_nested_drupal_form_submit_callback($value) { */ function batch_test_mock_form($form, $form_state) { $form['test_value'] = array( + '#title' => t('Test value'), '#type' => 'textfield', ); $form['submit'] = array( diff --git a/core/modules/system/tests/modules/database_test/database_test.module b/core/modules/system/tests/modules/database_test/database_test.module index 8772662..67b9bee 100644 --- a/core/modules/system/tests/modules/database_test/database_test.module +++ b/core/modules/system/tests/modules/database_test/database_test.module @@ -1,5 +1,6 @@ id()] = array( + 'title' => array('data' => array('#title' => String::checkPlain($account->name))), 'username' => check_plain($account->name), 'status' => $status[$account->status], ); diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module index 22e9f4f..236a867 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module @@ -555,6 +555,9 @@ function form_test_validate_required_form_no_title($form, &$form_state) { $form['textfield'] = array( '#type' => 'textfield', '#required' => TRUE, + '#property_validate' => array( + '#title' => array(), + ), ); $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array('#type' => 'submit', '#value' => 'Submit'); @@ -1017,6 +1020,9 @@ function form_label_test_form() { // and required marker. '#title' => '', '#required' => TRUE, + '#property_validate' => array( + '#title' => array(), + ), ); $form['form_textfield_test_title'] = array( '#type' => 'textfield', @@ -1039,6 +1045,9 @@ function form_label_test_form() { // Textfield test for title set not to display. $form['form_textfield_test_title_no_show'] = array( '#type' => 'textfield', + '#property_validate' => array( + '#title' => array(), + ), ); // Checkboxes & radios with title as attribute. $form['form_checkboxes_title_attribute'] = array( @@ -1912,6 +1921,7 @@ function _form_test_input_forgery($form, &$form_state) { // For testing that a user can't submit a value not matching one of the // allowed options. $form['checkboxes'] = array( + '#title' => t('Checkboxes'), '#type' => 'checkboxes', '#options' => array( 'one' => 'One', diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php index 02af7ce..504c866 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php @@ -218,6 +218,7 @@ public function buildOptionsForm(&$form, &$form_state) { } } $form['displays'] = array( + '#title' => t('Displays'), '#type' => 'checkboxes', '#description' => t('The feed icon will be available only to the selected displays.'), '#options' => $displays,