Problem/Motivation

Steps to reproduce

Create a page with a view, e.g. register it at path /foo
Open /foo - it will render, but somehow with content_format = markup.
Open /ce-api/foo - it has the markup cached and renders with markup!

When after a cache clear /ce-api/foo is opened first, all is working fine.

Proposed resolution

Fix cache context.

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

fago created an issue. See original summary.

fago’s picture

Category: Task » Bug report

This is at least major. This has the potential to confuse people + might break actual sites.

fago’s picture

ok, I finally tracked the problem down due to how cache-contexts are calculated.

Lupus CE renderer correctly adds this cache contexts:
'url.query_args:_content_format',
'url.query_args:_select',

But the problem is the _content_format is actually not changed via the query parameter, but lupus_decoupled_ce_api actually changes it via the request attribute. That means, lupus_ce_renderer should expose this is a new cache context which works like getContentFormatFromRequest().,
> $default_content_format = $request->attributes->get('lupus_ce_renderer.content_format', $content_format_settings);

useernamee’s picture

fago’s picture

https://www.drupal.org/project/lupus_ce_renderer/releases/2.4.0 got released - with the fix! Let's require it here to solve the issue.

fago’s picture

Status: Active » Needs review
useernamee’s picture

Status: Needs review » Reviewed & tested by the community
fago’s picture

Status: Reviewed & tested by the community » Fixed

  • fago committed 0e5ed878 on 1.x
    Issue #3520253 by fago, useernamee: Views pages have weird caching...

Status: Fixed » Closed (fixed)

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