Term pages using layout builder break when inserting taxonomy term views block

Created on 15 August 2020, over 4 years ago
Updated 27 February 2023, about 2 years ago

Problem/Motivation

I thought this is a pretty basic use case and should work out of the box: I want to build my own taxonomy term pages by adding content views with taxonomy term contextual filter into layout builder. Adding a block to the default taxonomy term view which is then added to the term page layout builder display this throws a WSOD on visiting the term page:

Notice: Undefined offset: 0 in /var/www/html.original/core/lib/Drupal/Core/Utility/Error.php on line 122

Notice: Undefined index: file in /var/www/html.original/core/includes/errors.inc on line 80

Notice: Undefined index: line in /var/www/html.original/core/includes/errors.inc on line 81

Notice: Undefined offset: 0 in /var/www/html.original/core/lib/Drupal/Core/Utility/Error.php on line 122

Notice: Undefined index: file in /var/www/html.original/core/includes/errors.inc on line 80

Notice: Undefined index: line in /var/www/html.original/core/includes/errors.inc on line 81

The log gives me:

Warning: Unknown: Cannot call session save handler in a recursive manner in main() (line of )

#0 /var/www/html.original/core/includes/bootstrap.inc(600): _drupal_error_handler_real(2, 'Unknown: Cannot...', 'Unknown', 0, NULL)
#1 [internal function]: _drupal_error_handler(2, 'Unknown: Cannot...', 'Unknown', 0, NULL)
#2 {main}

.

and

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in main() (line of )

#0 /var/www/html.original/core/includes/bootstrap.inc(600): _drupal_error_handler_real(2, 'Unknown: Failed...', 'Unknown', 0, NULL)
#1 [internal function]: _drupal_error_handler(2, 'Unknown: Failed...', 'Unknown', 0, NULL)
#2 {main}

.

Tenatatively marking as bug report. If this is not supposed to work out of the box, I'm happy to know which is the recommended way to do this.

Steps to reproduce

This was tested on simplytestme drupal 8.9.3 without any other modules installed (not even admin_toolbar..)

Configure taxonomy term views block

  1. go to admin/structure/views/view/taxonomy_term
  2. disable page because we want to use that url with layout builder
  3. add block
  4. switch contextual filter options for Content: Has taxonomy term ID under When the filter value is NOT available to Provide default value => Taxonomy term id from URL with Load default filter from term page

Configure tags term page display full

  1. en layout builder
  2. goto /admin/structure/taxonomy/manage/tags/overview/display
  3. enable Taxonomy term page under custom display options
  4. go to /admin/structure/taxonomy/manage/tags/overview/display/full
  5. enable Use layout builder
  6. under Manage display add taxonomy_term views block

Proposed resolution

  • The easy fix is to disable the view display page for Taxonomy term (Content) : Page. But we have to manage all terms with Layout Builder
  • The other better fix is to filter all terms which are using the layout builder

    A custom Taxonomy term views filter "Using Layout Builder" or "Not using Layout Builder" could be added to fix the issue

It feels that fix #2 could be better
Not sure if this fix could be in code or config
And the page could have a block display too to work with Layout Builder by default

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: duplicate

Version

9.1

Component
Layout builderΒ  β†’

Last updated about 4 hours ago

Created by

πŸ‡©πŸ‡ͺGermany anruether Bonn

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