When creating a theme, if you leave the description field empty in the themename.info.yml file, it throws a white screen error

Created on 9 May 2021, over 3 years ago
Updated 24 July 2023, over 1 year ago

Problem/Motivation

Brand new clean install of 9.1.8.

First thing I do is create a new theme in themes/custom/

I create the ...

themename.info.yml
and
themename.libraries.yml

Files.

name: themename
type: theme
description: 
core: 8.x
core_version_requirement: ^8 || ^9
# Defines the base theme
base theme: stark
# Defines libraries group in which we can add css/js.
libraries:
  - themename/global-styling
  - themename/global-scripts

When I go to /admin/appearance I get a white screen error with this error.

InvalidArgumentException: $string ("") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 132 of /app/web/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).

I left the "description" blank, cause... I didn't think I needed it.

I sorta deduced what the problem is, and added some characters so it had SOMETHING in the Description, and the problem went away.

I think this should not have a fatal error... or at least give you some better directions. I can see entry level theme builders throwing up their hands pretty quickly with a white screen error and they don't know how to turn on verbose error messages.

Steps to reproduce

See above.

Proposed resolution

Friendlier error messages, or allow for the Description field to be blank.

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

🐛 Bug report
Status

Closed: duplicate

Version

9.5

Component
Theme 

Last updated about 19 hours ago

Created by

🇺🇸United States alphex Atlanta, GA USA

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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