The title area handler currently don't care whether it's on an empty page or not,
so that you can't change the title of the frontpage view, unless you remove this area handler completely.

Files: 
CommentFileSizeAuthor
#21 drupal-1956912-21.patch7.46 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 53,920 pass(es). View
#21 interdiff.txt543 bytesdawehner
#13 1956912-13.patch7.47 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 53,940 pass(es). View
#13 interdiff.txt938 bytesdamiankloip
#8 1956912-8.patch863 bytesdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 53,880 pass(es). View
#4 drupal-1956912-4.patch6.8 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 53,740 pass(es). View
#4 interdiff.txt2.71 KBdawehner
#3 vdc-1956912-3.patch6.45 KBtim.plunkett
FAILED: [[SimpleTest]]: [MySQL] 53,686 pass(es), 1 fail(s), and 0 exception(s). View
#3 interdiff.txt4.24 KBtim.plunkett
#1 drupal-1956912-1.patch5.41 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 53,639 pass(es). View

Comments

dawehner’s picture

Status: Active » Needs review
FileSize
5.41 KB
PASSED: [[SimpleTest]]: [MySQL] 53,639 pass(es). View

Thanks for alexpott to find this issue.

A bugfix with some proper testing involved.

alexpott’s picture

Issue tags: +Alex's D8 blog

Tagging :)

tim.plunkett’s picture

FileSize
4.24 KB
6.45 KB
FAILED: [[SimpleTest]]: [MySQL] 53,686 pass(es), 1 fail(s), and 0 exception(s). View

The handler_type is only for area plugins, so cleaning this up a bit.

dawehner’s picture

FileSize
2.71 KB
6.8 KB
PASSED: [[SimpleTest]]: [MySQL] 53,740 pass(es). View

Really good point, so what about name it to areaType, as this is what this is all about?

Added also a small change to make the life or IDE people easier and probably improves performance?

alexpott’s picture

I've tested the patch and reviewed the changes and this fixes my problem. So this is RTBC.

However in testing the patch has raised some concerns about the ui... see #1957214: Title setting in views UI does not indicate when the title might be overridden

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

:)

damiankloip’s picture

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/Title.phpundefined
@@ -50,12 +50,14 @@ public function buildOptionsForm(&$form, &$form_state) {
+    if (!empty($this->options['title']) && ($this->areaType != 'empty' || empty($results))) {

Is there a different issue here? As the title handler is only available for empty areas, so they shouldn't be even used unless the view is actually empty.

damiankloip’s picture

FileSize
863 bytes
PASSED: [[SimpleTest]]: [MySQL] 53,880 pass(es). View

Like this, just an idea. As template_preprocess_views_view will check the view is empty before calling render() on the empty area handlers.

Sorry for doing this on RTBC :)

dawehner’s picture

render() can also be called on header/footer if the result is empty (as there is a setting for that) so don't call preRender() seems to be wrong.

webchick’s picture

Status: Reviewed & tested by the community » Needs review

I can't tell if this is RTBC or not?

damiankloip’s picture

@dawehner, I was only thinking of not calling preRender for empty area if the result is empty. Not to do with the setting, and the title handler is only available for empty areas currently?

dawehner’s picture

Oh I see, yeah we could merge this two pages together, as the other one contains test fixes and one other one.

damiankloip’s picture

FileSize
938 bytes
7.47 KB
PASSED: [[SimpleTest]]: [MySQL] 53,940 pass(es). View

Yep, that sounds good. The tests look good to me.

Interdiff just shows the change I made to Title.php.

Status: Needs review » Needs work
Issue tags: -VDC, -Alex's D8 blog

The last submitted patch, 1956912-13.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
Issue tags: +VDC, +Alex's D8 blog

#13: 1956912-13.patch queued for re-testing.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

The changes from damian look great. Thanks for the simplification.

xjm’s picture

Title: Title area handler sets the title all the time. » Title area handler sets the title all the time (results in "Welcome to Drupal" never going away)
Priority: Normal » Major

@damiankloip marked #1961184: "Welcome to Drupal" title (frontpage view "no results" behavior) persists even when there are results as a duplicate. I spent 30 minutes trying to find the bug report that I was sure must exist for this before I filed it, so please let's put more information in the issue summaries. See that issue for an example of a good start to a summary, or review http://drupal.org/node/1155816. I searched for "no results" and "global title override" and "Welcome to Drupal" and many many combinations of these keywords, and never found this issue.

For maintainers: One result of this bug is that the "Welcome to Drupal" site title persists even after content is added to the site.
very_welcoming.png

Every single site builder will run into this bug, so this is major.

xjm’s picture

Title: Title area handler sets the title all the time (results in "Welcome to Drupal" never going away) » Title area handler sets the title even when it should not (results in "Welcome to Drupal" never going away)
xjm’s picture

Issue tags: +Quick fix

:)

webchick’s picture

Status: Reviewed & tested by the community » Needs work

This will need a re-roll because human_name no longer exists.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
543 bytes
7.46 KB
PASSED: [[SimpleTest]]: [MySQL] 53,920 pass(es). View

Oh right

Rerolled.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

W00t!

Committed and pushed to 8.x. Thanks!

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