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

Files: 
CommentFileSizeAuthor
#5 2112233-5.patch2.29 KBamateescu
PASSED: [[SimpleTest]]: [MySQL] 59,839 pass(es). View
#2 1-2.interdiff.txt847 bytesalexpott
#2 2112233.2.patch2.32 KBalexpott
PASSED: [[SimpleTest]]: [MySQL] 58,847 pass(es). View
#1 2112233.1.patch1.41 KBalexpott
PASSED: [[SimpleTest]]: [MySQL] 59,129 pass(es). View

Comments

alexpott’s picture

Issue summary: View changes

Updated issue summary.

alexpott’s picture

Status: Active » Needs review
Issue tags: +Configuration system
FileSize
1.41 KB
PASSED: [[SimpleTest]]: [MySQL] 59,129 pass(es). View
alexpott’s picture

Title: Remove unnecessary ternaries in around config('system.theme')->get('default') in tests. » Remove unnecessary ternaries in around config()->get()
FileSize
2.32 KB
PASSED: [[SimpleTest]]: [MySQL] 58,847 pass(es). View
847 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
FileSize
2.29 KB
PASSED: [[SimpleTest]]: [MySQL] 59,839 pass(es). View

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.