Compatibility with PHP8.1

Created on 12 April 2023, over 1 year ago
Updated 13 April 2023, over 1 year ago

Problem/Motivation

The theme is not compatible with PHP 8.1.x.

Steps to reproduce

Fresh install, Electra activated and chosen as default theme, first page call throws errors

Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in electra_preprocess() (line 114 of themes/contrib/electra/electra.theme)

This happens due to no value is set in the corresponding preferences. Looking at line 114 in electra.theme, the solution is to check whether the parameter is set and make it ' ' if it isn't, like

$value = trim(theme_get_setting($social_profile, 'electra') ?? '');

Works for me, hope this helps.

🐛 Bug report
Status

RTBC

Version

3.2

Component

Code

Created by

🇩🇪Germany upunkt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024