As figured out in #1957346: Add some settings on the block display to allow overrides on the block instance configuration the default value of use_more_always should be TRUE,
as this saves a full count query (similar to pager queries).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DuaelFr’s picture

Status: Active » Needs review
FileSize
625 bytes

This issue was covered during the first Drupal Sprint of Montpellier (France).

dawehner’s picture

Maybe we should make a small test as well.

dawehner’s picture

Issue tags: +Needs tests

Add tag

dawehner’s picture

Status: Needs review » Needs work

Add tag

lokapujya’s picture

Trying to understand what test is needed.

But, I have a question: in the defaults array:
protected function defineOptions() {
$options = array(
'defaults' => array(

Comments Say "The $options array is An array which describes the options of a plugin. Each element is an associative array containing: - default: The default value of one option"

So, why would the defaults array contain a different default value than is set for option's default?

dawehner’s picture

So, why would the defaults array contain a different default value than is set for option's default?

The 'defaults' subarray is used to determine whether a certain option should be marked as overridden right from the beginning when you add a new display, so you never can really change the value provided by the master/default display.

lokapujya’s picture

Issue summary: View changes

Updated issue summary.

olli’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
1.43 KB

Here's a small test.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I like the test!

lokapujya’s picture

Should the test also verify that "Use more always" works when the view is placed in a block layout?

webchick’s picture

Status: Reviewed & tested by the community » Fixed

I had a similar question to lokapujya about the test, but dawehner pointed out in IRC that the remainder of https://api.drupal.org/api/drupal/core!modules!views!lib!Drupal!views!Te... does test other aspects of the link, including whether it's output correctly when placed as content on a page.

I got confused while testing this, because I didn't realize that "use more always" was a separate setting from the "use more" setting to actually put a link to the page display on a block. So what this patch does is IF "use more link" is checked on a block display, it will then *always* show the "more" link in the block, even if there are < the total # of things per page. I think that is a bit of a regression in usability in a minority of cases (we're kind of lying to the viewer by saying "there's other stuff you're not seeing here" and in fact there is not), but in the vast majority where the number of total things is > the number of things shown in the block, it will indeed be a performance boost, and more render cache-friendly as well (as dawehner pointed out in IRC). And people who are hitting the usability issue can always uncheck the checkbox to conditionally display it, if their users are complaining about it.

So... Committed and pushed to 8.x. Thanks!

dawehner’s picture

Thank you, that was quite a bit of "work" for a single line change ;)

Status: Fixed » Closed (fixed)

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