[WxT 5.2.x][PHP 8.2] PHP deprecation warning when loading a missing *.map file

Created on 18 March 2024, 6 months ago
Updated 15 April 2024, 6 months ago

I just noticed that, when loading in my browser the missing *.map file mentioned in the issue 3417936 , I get this PHP warning from the webform module:

Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in webform_form_alter() (line 35 of /var/www/html/html/modules/contrib/webform/includes/webform.form_alter.inc)
#0 /var/www/html/html/core/includes/bootstrap.inc(164): _drupal_error_handler_real(8192, 'preg_match(): P...', '/var/www/html/h...', 35)
#1 [internal function]: _drupal_error_handler(8192, 'preg_match(): P...', '/var/www/html/h...', 35)
#2 /var/www/html/html/modules/contrib/webform/includes/webform.form_alter.inc(35): preg_match('/^entity.webfor...', NULL)
#3 /var/www/html/html/core/lib/Drupal/Core/Extension/ModuleHandler.php(545): webform_form_alter(Array, Object(Drupal\Core\Form\FormState), 'webform_submiss...')
#4 /var/www/html/html/core/lib/Drupal/Core/Form/FormBuilder.php(841): Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object(Drupal\Core\Form\FormState), 'webform_submiss...')
#5 /var/www/html/html/core/lib/Drupal/Core/Form/FormBuilder.php(284): Drupal\Core\Form\FormBuilder->prepareForm('webform_submiss...', Array, Object(Drupal\Core\Form\FormState))
#6 /var/www/html/html/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\webform\WebformSubmissionForm), Object(Drupal\Core\Form\FormState))
#7 /var/www/html/html/modules/contrib/webform/src/Entity/Webform.php(1257): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\webform\Entity\WebformSubmission), 'add')
#8 /var/www/html/html/modules/contrib/webform/src/WebformEntityViewBuilder.php(18): Drupal\webform\Entity\Webform->getSubmissionForm()

I already created a patch to add a condition in the webform.form_alter.inc file to fix this: https://www.drupal.org/project/webform/issues/3431852 🐛 When a Webform is loaded on a 404 page: [PHP 8.1] Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in webform_form_alter() Needs review that needs to be review, in the meantime, I can create a patch for the composer.json file to include this patch.

🐛 Bug report
Status

Fixed

Version

5.2

Component

Code

Created by

🇨🇦Canada optasy

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

Comments & Activities

Production build 0.71.5 2024