Broken theme when enabling extension "Shortcode CSS Classes"

Created on 24 November 2024, 5 months ago

Problem/Motivation

Broken theme when enabling extension "Shortcode CSS Classes"

Steps to reproduce

1. Create a subtheme with AT Theme Generator
2. Enable extension -> Shortcode CSS Classes

Then:
Message: "The website encountered an unexpected error. Try again later."

In dblog i have the following error msg:

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in themes/contrib/adaptivetheme/at_core/forms/ext/shortcodes.php

Proposed resolution

I think the problem are the lines:

'#default_value' => Html::escape(theme_get_setting('settings.page_classes_' . $page_elements_key, $theme)),

I've solved it providing a default value '' when the string is null:

'#default_value' => Html::escape(theme_get_setting('settings.page_classes_' . $page_elements_key, $theme) ?? ''),

(these problems repeat in other parts of the code of shortcodes.php)

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

7.1

Component

Extensions

Created by

πŸ‡ΊπŸ‡ΎUruguay rsbarbano

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024