Skip to content
Snippets Groups Projects

Resolve #2973356 "Route access check cacheability ignored"

Closes #2973356

Merge request reports

Approval is optional
Code Quality is loading
Test summary results are being parsed

Closed by catchcatch 7 months ago (Sep 9, 2024 7:47pm UTC)

Merge details

  • The changes were not merged into 11.x.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
33 33 * Tests dynamic page cache.
34 34 */
35 35 public function testDynamicPageCache(): void {
36 $node_type = $this->drupalCreateContentType();
37 $node = $this->drupalCreateNode(['type' => $node_type->id()]);
36 38 $this->drupalLogin($this->drupalCreateUser([
37 39 'access toolbar',
38 40 'access announcements',
39 41 ]));
40 // Front-page is visited right after login.
  • This was an invalid expectation because on default installations the user lands on the user/[id] after login and that has user cache context now bubbling up from \Drupal\user\UserAccessControlHandler::checkAccess() as it should have been.

            // Users can view own profiles at all times.
            elseif ($account->id() == $entity->id()) {
              return AccessResult::allowed()->cachePerUser();
            }
  • Please register or sign in to reply
  • 173 173 $this->assertSession()->pageTextNotContains($label);
    174 174 $this->assertCacheContexts(['languages:language_content', 'languages:language_interface', 'theme', 'url.query_args:' . MainContentViewSubscriber::WRAPPER_FORMAT, 'url.site', 'user', 'route']);
    175 175
    176 // Ensure that a page that does not have a node context can still be cached,
    177 // the front page is the user page which is already cached from the login
    178 // request above.
    176 // Ensure that a page that does not have a node context can still be cached.
    177 \Drupal::service('module_installer')->install(['dynamic_page_cache_test']);
  • 104 104 * Tests that the toolbar workspace switcher doesn't disable the page cache.
    105 105 */
    106 106 public function testToolbarSwitcherDynamicPageCache() {
    107 $node_type = $this->drupalCreateContentType();
    108 $node = $this->drupalCreateNode(['type' => $node_type->id()]);
    107 109 $this->drupalLogin($this->drupalCreateUser([
    108 110 'access toolbar',
    109 111 'view any workspace',
    110 112 ]));
    111 // Front-page is visited right after login.
  • added 1 commit

    • 5f84b6de - Try to lower the weight of DynamicPageCacheSubscriber instead.

    Compare with previous version

  • added 1 commit

    • db7a5847 - Revert "Try to lower the weight of DynamicPageCacheSubscriber instead."

    Compare with previous version

  • Dezső Biczó
  • 3045 3045 'url.query_args:resourceVersion',
    3046 3046 'url.site',
    3047 3047 ];
    3048 $this->assertResourceErrorResponse(501, 'JSON:API does not support filtering on revisions other than the latest version because a secure Drupal core API does not yet exist to do so.', $rel_working_copy_collection_url_filtered, $actual_response, FALSE, ['http_response'], $filtered_collection_expected_cache_contexts);
    3048 $this->assertResourceErrorResponse(501, 'JSON:API does not support filtering on revisions other than the latest version because a secure Drupal core API does not yet exist to do so.', $rel_working_copy_collection_url_filtered, $actual_response, FALSE, ['http_response'], $filtered_collection_expected_cache_contexts, FALSE, 'UNCACHEABLE');
  • Dezső Biczó added 25 commits

    added 25 commits

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading