Problem/Motivation

Views allows to specify a different title in case the view result is empty.

This feature is for example used by "/node" to display "Welcome to Drupal", so it is not just an edge-case feature.

Proposed resolution

As #2359901: Discourage $main_content['#title'] in favor of route titles and title callbacks would have maybe dropped support for it ensure that we have a even more dedicated test coverage for it.

Remaining tasks

User interface changes

API changes

Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new2.32 KB

Here is an expanded test coverage.

Status: Needs review » Needs work

The last submitted patch, 1: 2359931-1.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new3.02 KB
new722 bytes

There we go, we changed the test view, so we have to adapt the test as well.

damiankloip’s picture

+++ b/core/modules/views/src/Tests/Handler/AreaTitleWebTest.php
@@ -0,0 +1,66 @@
+      'value' => 1000,

NIT ALERT: Can we just add a comment that you are adding this so the view returns no results? pretty please.

Or make the value even more ridiculous?

dawehner’s picture

StatusFileSize
new3.08 KB
new579 bytes

Sure ...

damiankloip’s picture

Status: Needs review » Reviewed & tested by the community

Much better. That is a nice value - thanks.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 5: 2359931-5.patch, failed testing.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new3.02 KB

Okay, I'm done, I forgot how to write views config by hand :P

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed a6c2d42 and pushed to 8.0.x. Thanks!

  • alexpott committed a6c2d42 on 8.0.x
    Issue #2359931 by dawehner: Ensure that empty title support does not...

Status: Fixed » Closed (fixed)

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