[Regression] Taxonomy term page missing HTML links canonical and shortlink when using views

Created on 15 January 2023, almost 2 years ago
Updated 26 January 2023, almost 2 years ago

Problem/Motivation

When viewing a term page like /taxonomy/term/1, or its alias, the rendered page is missing the links rel="canonical" and rel="shortlink". This is a regression starting at 9.3.0.

This only applies when the view taxonomy_term is enabled, but that means site builders need to pick between having a term page that lists content OR having a term page with canonical links (and therefore better SEO).

Background

In #2922570: The node view page triggers a lot of expensive access checks for relationship links β†’ the addition of these links was moved from taxonomy_page_attachments_alter() to the EntityViewController. Since the taxonomy_term view takes over the canonical route and bypasses the term view controller, the links are never added.

Steps to reproduce

  1. Install Drupal (standard install profile)
  2. Create a term in the existing "Tags" vocabulary
  3. View the term page and see that there AREN'T canonical or shortlink links
  4. Disable the "Taxonomy term (Content)" view
  5. View the term page and see that there ARE canonical and shortlink links

Proposed resolution

Revert the removal of taxonomy_page_attachments_alter().

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
TaxonomyΒ  β†’

Last updated 7 minutes ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @xjm
  • πŸ‡¬πŸ‡§United Kingdom @catch
Created by

πŸ‡ΊπŸ‡ΈUnited States rocketeerbkw Austin, Tx

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024