Problem/Motivation
A route with _layout_builder: 'false' displays Layout Builder help. For example, the "Performance" page can tell admins how to edit the layout of the main content area, even though the page only contains performance settings.
LayoutBuilderHooks::help() treats the non-empty string 'false' as true. NavigationHooks::help() does the same on routes whose names start with layout_builder.navigation., where it displays help about editing the navigation toolbar.
Steps to reproduce
- Enable Layout Builder and Help, and place the Help block in the admin theme.
- In a test module, set the
_layout_builderoption onsystem.performance_settingsto the string'false'in a route alter. Rebuild caches and visit/admin/config/development/performance. Layout editing instructions appear. - Set the option to boolean
FALSE, rebuild caches and reload the page. The layout editing instructions disappear.
Proposed resolution
Use BooleanRouteOption::get() from #3644412: [PP-1] Routing treats "false" as TRUE for _admin_route and no_cache in LayoutBuilderHooks::help() and NavigationHooks::help().
Test that _layout_builder: 'false' triggers a deprecation naming the option and produces no layout editing help. Cover both the standard Layout Builder help and the toolbar-specific help on layout_builder.navigation.view. Keep the existing help for boolean TRUE.
Remaining tasks
Postponed on #3644412: [PP-1] Routing treats "false" as TRUE for _admin_route and no_cache.
In Drupal 13: Track rejection of deprecated inputs in #3644403: [13.x] Reject deprecated non-boolean input in boolean config values.
User interface changes
Routes with _layout_builder: 'false' no longer display layout editing instructions.
API changes
The _layout_builder route option follows the boolean input rules from #3644412: [PP-1] Routing treats "false" as TRUE for _admin_route and no_cache. Use unquoted booleans in routing YAML and native booleans in PHP.
Data model changes
None.
Release notes snippet
Layout Builder and Navigation now suppress layout editing help when _layout_builder is set to the deprecated string 'false'.
Issue fork drupal-3644424
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