TypeError on ColorFieldWidgetBox

Created on 11 January 2024, 6 months ago

Problem/Motivation

When using color field widget box this error occurs:
TypeError: preg_match_all(): Argument #2 ($subject) must be of type string, null given in preg_match_all() (line 123 of /modules/contrib/color_field/src/Plugin/Field/FieldWidget/ColorFieldWidgetBox.php).

Steps to reproduce

Use the widget.

Proposed resolution

getSetting() will return null when nothing is set yet. preg_match_all expects a string, so give it a string when getSetting returns null.

See patch.

Remaining tasks

Review

πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands JohanKleene Helmond

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

Comments & Activities

Production build 0.69.0 2024