The system.theme.default key is always set. This code is unnecessarily complex as the default is provided in the system.theme config file.

$default_theme = \Drupal::config('system.theme')->get('default') ?: 'stark';

Related issue: #2090751: Add a default parameter to the config get() method

Comments

alexpott’s picture

Issue summary: View changes

Updated issue summary.

alexpott’s picture

Status: Active » Needs review
Issue tags: +Configuration system
StatusFileSize
new1.41 KB
alexpott’s picture

Title: Remove unnecessary ternaries in around config('system.theme')->get('default') in tests. » Remove unnecessary ternaries in around config()->get()
StatusFileSize
new2.32 KB
new847 bytes

Whilst we're at let's stop pretending that a permission description is only useful when you don't have a separate admin theme configured.

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Sweet cleanup.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Patch no longer applies.

amateescu’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs reroll
StatusFileSize
new2.29 KB

Rerolled.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

dries’s picture

Issue summary: View changes

Fix

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.