diff -u b/core/modules/views/src/Plugin/views/area/Result.php b/core/modules/views/src/Plugin/views/area/Result.php --- b/core/modules/views/src/Plugin/views/area/Result.php +++ b/core/modules/views/src/Plugin/views/area/Result.php @@ -54,6 +54,7 @@ '@start -- the initial record number in the set', '@end -- the last record number in the set', '@total -- the total records in the set', + '@total_format -- the total records in the set (number formatted)', '@label -- the human-readable name of the view', '@per_page -- the number of items per page', '@current_page -- the current page number', @@ -138,6 +139,7 @@ $this->replacements['@start'] = $start; $this->replacements['@end'] = $end; $this->replacements['@total'] = $this->total; + $this->replacements['@total_format'] = number_format($this->total, '.', ','); $this->replacements['@label'] = $label; $this->replacements['@per_page'] = $per_page; $this->replacements['@current_page'] = $current_page; diff -u b/core/modules/views/src/Plugin/views/area/ResultPlural.php b/core/modules/views/src/Plugin/views/area/ResultPlural.php --- b/core/modules/views/src/Plugin/views/area/ResultPlural.php +++ b/core/modules/views/src/Plugin/views/area/ResultPlural.php @@ -40,7 +40,7 @@ '@start', '@end', '@total', - '@name', + '@label', '@per_page', '@current_page', '@current_record_count', @@ -57,7 +57,7 @@ '#type' => 'select', '#title' => $this->t('Count token'), '#description' => $this->t('Token used to detect plurality. If the token value is more than one, the "Plural form" textarea will be used.'), - '#default_value' => (isset($this->options['plural_count_token']) ? $this->options['plural_count_token'] : ''), + '#default_value' => ($this->options['plural_count_token'] ?? ''), '#options' => array_combine($format_plural_count_options, $format_plural_count_options), ]; $form['content_plural'] = [ diff -u b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_area_result_plural.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_area_result_plural.yml --- b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_area_result_plural.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_area_result_plural.yml @@ -50,8 +50,8 @@ group_type: group admin_label: '' empty: true - content: "SINGULAR start: @start | end: @end | total: @total | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count" - content_plural: 'PLURAL start: @start | end: @end | total: @total | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count' + content: "SINGULAR start: @start | end: @end | total: @total | total formatted: @total_format | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count" + content_plural: 'PLURAL start: @start | end: @end | total: @total | total formatted: @total_format | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count' plural_count_token: '@start' plugin_id: result_plural display_plugin: default @@ -72,8 +72,8 @@ group_type: group admin_label: '' empty: false - content: "SINGULAR start: @start | end: @end | total: @total | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count" - content_plural: 'PLURAL start: @start | end: @end | total: @total | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count' + content: "SINGULAR start: @start | end: @end | total: @total | total formatted: @total_format | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count" + content_plural: 'PLURAL start: @start | end: @end | total: @total | total formatted: @total_format | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count' plural_count_token: '@start' plugin_id: result_plural display_plugin: page diff -u b/core/modules/views/tests/src/Kernel/Handler/AreaResultPluralTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaResultPluralTest.php --- b/core/modules/views/tests/src/Kernel/Handler/AreaResultPluralTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/AreaResultPluralTest.php @@ -30,7 +30,7 @@ $output = $view->render(); $output = \Drupal::service('renderer')->renderRoot($output); $this->setRawContent($output); - $this->assertText('SINGULAR start: 1 | end: 5 | total: 5 | label: test_area_result_plural | per page: 0 | current page: 1 | current record count: 5 | page count: 1'); + $this->assertText('SINGULAR start: 1 | end: 5 | total: 5 | total formatted: 5 | label: test_area_result_plural | per page: 0 | current page: 1 | current record count: 5 | page count: 1'); } /** @@ -58,7 +58,7 @@ $output = $view->render(); $output = \Drupal::service('renderer')->renderRoot($output); $this->setRawContent($output); - $this->assertText('PLURAL start: 0 | end: 0 | total: 0 | label: test_area_result_plural | per page: 0 | current page: 1 | current record count: 0 | page count: 1'); + $this->assertText('PLURAL start: 0 | end: 0 | total: 0 | total formatted: 0 | label: test_area_result_plural | per page: 0 | current page: 1 | current record count: 0 | page count: 1'); $this->assertRaw('
'); // Test that the area is not displayed if we have not checked the empty @@ -69,7 +69,7 @@ $output = $view->render(); $output = \Drupal::service('renderer')->renderRoot($output); $this->setRawContent($output); - $this->assertNoText('PLURAL start: 0 | end: 0 | total: 0 | label: test_area_result_plural | per page: 0 | current page: 1 | current record count: 0 | page count: 1'); + $this->assertNoText('PLURAL start: 0 | end: 0 | total: 0 | total formatted: 0 | label: test_area_result_plural | per page: 0 | current page: 1 | current record count: 0 | page count: 1'); // Make sure the empty header region isn't rendered. $this->assertNoRaw('
'); } only in patch2: unchanged: --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_area_result.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_area_result.yml @@ -50,7 +50,7 @@ display: group_type: group admin_label: '' empty: true - content: "