Problem/Motivation

template_preprocess_html contains:

  // @todo Remove once views is not bypassing the view subscriber anymore.
  //   @see https://www.drupal.org/node/2068471
  elseif ($is_front_page) {
    $head_title = [
      'title' => t('Home'),
      'name' => $site_config->get('name'),
    ];
  }

That issue was closed. So we should be safe to remove that special case.

Proposed resolution

We probably need a test ensuring this. The test should create a view, set it as the home, and ensure the title is Home and not the views title.

Remaining tasks

Patch removing that code, test.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Issue fork drupal-3355678

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

penyaskito created an issue. See original summary.

penyaskito’s picture

I *think* this could be removed and there would be no effect.
Because if I set a view as the homepage, the homepage will already have that #title. So if we consider that a bug, the bug is already in core.

Gauravvvv made their first commit to this issue’s fork.

gauravvvv’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs tests

Needs failure seems legit to this.

And as mentioned a test case showing this should be included. As removing it did break a test.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

penyaskito changed the visibility of the branch 3355678-cleanup-head-title to hidden.

penyaskito changed the visibility of the branch 11.x to hidden.

penyaskito’s picture

When I created this, I wrote the Proposed resolution as:

"The test should create a view, set it as the home, and ensure the title is Home and not the views title."

Which currently with HEAD is not even true.
If I create a view, set it as the home, the title won't be Home but the views title.

So we first need to define if that's the correct behavior.

penyaskito’s picture

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.