Lazy Builder scan has false positive

Created on 6 September 2023, over 1 year ago
Updated 20 September 2023, over 1 year ago

Problem/Motivation

When scanning a custom module, render arrays with #lazy_builder are flagged as incompatible when the lazy builder is not a callable. However, the #lazy_builder syntax accepts noncallables in the form of service.key:methodName. See \Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter::viewElements for an example of this pattern in core.

Steps to reproduce

Run against a module which uses the service key pattern instead of the callable pattern.

Proposed resolution

Support the service key pattern, or flag uses of #lazy_builder which do not have a callable as a warning rather than an error.

Remaining tasks

Create patch.

User interface changes

None.

API changes

None.

Data model changes

None.

๐Ÿ› Bug report
Status

Postponed

Version

4.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States socketwench

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024