Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300758

Pager plugin "Some", [view:total-rows] token and Result Summary @total token Regression Issue

$
0
0

Problem/Motivation

The solution to #3265798: [view:total-rows] problem in Display a 'Specified number of items' pager introduced the following regression related issues:

  1. #3381979: More link is missing in pager when using the "Some" pager and there are more records than shown
  2. #1819538: More link disappears when time-based views cache is enabled
  3. Also any site using @current_record_count of @total in a Results Summary with a Some pager now has unexpected results as of version 10.1.0. (See comment below https://www.drupal.org/project/drupal/issues/3481310#comment-15821835)

Before these issues can be fixed, I believe a decision needs to be made as to what exactly the [view:total-rows] token and the @total token on a Results Summary should return based on the pager selected and other display configurations, as this will affect how these issues are solved.

The description of the [view:total-rows] token is The total amount of results returned from the view. The current display will be used..

#3265798: [view:total-rows] problem in Display a 'Specified number of items' pager interpreted that to be the total number of results returned from the query which can be limited by the pager. So if I am using the Some pager and only displaying 5 results when there are say 20, [view:total-rows] should only return 5.

But what I want to add text to the View header that says "Displaying 5 of 20". I believe this is a valid especially if using a More link or another link to the a page displaying all results. This can no longer be done because of the changes in #3265798: [view:total-rows] problem in Display a 'Specified number of items' pager.

Proposed resolution

Option #1 (Preferred)

See https://git.drupalcode.org/project/drupal/-/merge_requests/9888

  1. Revert changes added in #3265798: [view:total-rows] problem in Display a 'Specified number of items' pager
  2. Update [view:total-rows] token description to explain it is the total items before pager limits are applied and add helpful reference to Result Summary and @current_record_count token if they need the number of results on the current page.
  3. Possibly add a new token to provide the equivalent of @current_record_count. (Not included in MR 9888).

Option #2

See https://git.drupalcode.org/project/drupal/-/merge_requests/9856

  1. Refactor functionality so the [view:total-rows] token returns the total number of results ignoring any limits applied by the "Some" pager if the "More link" is enabled.
  2. Update [view:total-rows] token description to provide more information on what it can be affected by.

Remaining tasks

  1. Determine how the value returned from [view:total-rows] token and @total token in a Results Summary should be affected by the "Some" pager and possibly More link.
  2. Based on the decision of #1 determine other remaining tasks i.e. token description update, tests, new token.

Viewing all articles
Browse latest Browse all 300758

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>