- Issue created by @sd123
- ๐ฎ๐ณIndia __i.am.prashant__
__i.am.prashant__ โ made their first commit to this issueโs fork.
- ๐ฎ๐ณIndia sakthi_dev
@sd123, Could you please share the steps to reproduce it with the details like version and all. Not able to reproduce the mentioned issue.
Drupal Version: 10.1
PHP Version: 8.1 I did some testing and it happens each time someone presses the preview button on the contact form.
As a workaround, I just removed the preview feature from my site.
PHP 8.2.7
Drupal 10.2.3- ๐ฎ๐ณIndia __i.am.prashant__
Hello @sd123,
I attempted to replicate the problem using PHP 8.2 and Drupal 10.2.3, but I was unable to do so. Could you kindly explain in brief how I can replicate the problem? If it's feasible, please include a gif or image. - Assigned to mohd sahzad
- last update
about 1 year ago 9 pass - Status changed to Needs review
about 1 year ago 5:29am 14 February 2024 Step 1:
Step 2:
This is logged when pressing the Preview button:
Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\color\ColorSystemBrandingBlockAlter::preRender() (line 27 of /PATH/TO/SITE/web/modules/contrib/color/src/ColorSystemBrandingBlockAlter.php) #0 /PATH/TO/SITE/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real() feb 14 11:25:03 vps1 drupal[512150]: #1 [internal function]: _drupal_error_handler() feb 14 11:25:03 vps1 drupal[512150]: #2 /PATH/TO/SITE/web/modules/contrib/color/src/ColorSystemBrandingBlockAlter.php(27): preg_match() feb 14 11:25:03 vps1 drupal[512150]: #3 [internal function]: Drupal\color\ColorSystemBrandingBlockAlter::preRender() feb 14 11:25:03 vps1 drupal[512150]: #4 /PATH/TO/SITE/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(111): call_user_func_array() <snip>
Ok, I am also getting the error without the Preview button. This is how I can trigger the error in the logs:
- Put a space only in the Subject field.
- Enter something in all other fields.
- Press the Send message button.
- The error "Subject field is required." appears on the screen + Deprecated function: preg_match() in ColorSystemBrandingBlockAlter.php is logged.
I can reproduce this too using Drupal 10.2.4 and color 1.0.3.
- Select a theme that supports the color module (such as bartik)
- Select a non-default color scheme
- Remove the site logo by unchecking "Use the logo supplied by the theme".
- Save the color settings.
- Visit the site home page.
The error appears in the log (or on the screen, depending on error reporting settings).
- Status changed to RTBC
about 1 year ago 1:48pm 4 April 2024 Oops, I overlooked that merge request.
I can confirm it also fixes the issue for me.
- Issue was unassigned.
- Status changed to Needs work
12 months ago 11:32am 20 April 2024 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
The steps to reproduce this bug needs to be put in the issue summary, not in various comments.