Overview
The site has Drupal 11.3.3, Canvas 1.2.0, and content types use layout builder enabled to manage display. The error occurs when selecting the manage layout button.
The website encountered an unexpected error. Try again later.
DBlog reports:
location: /admin/structure/types/manage/page/display/default/layout
referrer: /admin/structure/types/manage/page/display
TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 19 of /code/web/modules/contrib/canvas/src/Plugin/Field/FieldTypeOverride/CoreBugFixTextItemBaseGenerateSampleValueTrait.php).
Proposed resolution
User interface changes
Issue fork canvas-3576410
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
Comment #2
bsnodgrass commentedFWIW This is an old site originally built in Drupal 8 and maintained on a regular basis. We are currently in the process of updating to use Drupal Canvas and a new theme.
Comment #5
nickolajReplace `count($settings['allowed_formats'])` with `!empty($settings['allowed_formats'])` in `CoreBugFixTextItemBaseGenerateSampleValueTrait.php` to handle null `allowed_formats` setting, which causes a TypeError on the Manage Display page for non-Canvas view modes.