Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291508

Empty 'libraries:' in theme .info.yml file produces confusing PHP warning

$
0
0

Problem/Motivation

Steps to reproduce:

Create a new theme. In the .info.yml file include this line but don't declare any libraries underneath it or append [].

libraries:

When installing your theme or clearing caches you should see the following:

Warning: Invalid argument supplied for foreach() in Drupal\Core\Extension\ThemeHandler->addTheme() (line 203 of core/lib/Drupal/Core/Extension/ThemeHandler.php).

Proposed resolution

Either ignore that libraries is not an array at this point, or throw a meaningful exception. Either would improve the experience.

Remaining tasks

Patch
Tests
Review

User interface changes

n/a

API changes

n/a

Data model changes

n/a


Viewing all articles
Browse latest Browse all 291508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>