Excerpt fields are not rendered for anonymous users

Created on 19 April 2021, over 3 years ago
Updated 21 August 2024, 4 months ago

Problem/Motivation

When using the "Search result excerpt" field in a view mode, the field's content is not rendered for anonymous users.
RenderedItem's $build = $datasource->viewItem($item->getOriginalObject(), $view_mode) is called multiple times by the Highlight Processor. The first time it's called, it returns NULL which gets cached.

Steps to reproduce

  1. Enable the Highlight processor.
  2. Set "Highlight returned field data" to Always.
  3. Enable "Create excerpt".
  4. Add the Search result excerpt field to a view mode (e.g. Teaser).
  5. Create a View, select "Show: Rendered entity" and select the display with the excerpt field.
  6. Index the items, view the results as an anonymous user.

Proposed resolution

Add appropriate cache keys to the render array.

🐛 Bug report
Status

Needs work

Version

1.0

Component

Plugins

Created by

🇬🇧United Kingdom aimai

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

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