Module causes double rendering of blocks just to check access

Created on 28 May 2021, about 3 years ago
Updated 12 October 2023, 9 months ago

Problem/Motivation

This module's blocks cause a double render just to check block access. This is causing performance problems.

https://git.drupalcode.org/project/menu_block/-/blob/8.x-1.x/src/Plugin/...

    $build = $this->build();
    if (empty($build['#items'])) {
      return AccessResult::forbidden();
    }

Only page_cache could protect from this. Not dynamic_page_page or render cache.

Steps to reproduce

Proposed resolution

Removing existing check. Just return an empty array.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

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.69.0 2024