Problem/Motivation

I've seen a handful of deprecation issues around here marked as closed/fixed, yet I'm still seeing deprecation warnings:

Deprecated function: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\webform\Plugin\WebformElementBase->prepare() (line 731 of modules/contrib/webform/src/Plugin/WebformElementBase.php).

Steps to reproduce

I'm running this on my local using Lando for the containers.
All debug stuff is enabled on local.
Create a webform, view webform, see error.

Deprecated function: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\webform\Plugin\WebformElementBase->prepare() (line 731 of modules/contrib/webform/src/Plugin/WebformElementBase.php).
Drupal\webform\Plugin\WebformElementBase->prepare(Array, Object) (Line: 49)
Drupal\webform\Plugin\WebformElement\TextBase->prepare(Array, Object) (Line: 46)
Drupal\webform\Plugin\WebformElement\TextField->prepare(Array, Object) (Line: 173)
etc...

Proposed resolution

Let's knock these out. Patch forthcoming for this one.

Remaining tasks

Find all of these. :D

Comments

seanr created an issue. See original summary.

seanr’s picture

Status: Active » Needs review
StatusFileSize
new1.16 KB
seanr’s picture

StatusFileSize
new2.88 KB

Better one and catch some more...

seanr’s picture

Yahtzee! No more errors. :D I could use some help just to make sure this patch doesn't introduce any issues I'm not seeing...

jrockowitz’s picture

Status: Needs review » Postponed (maintainer needs more info)

webform.settings.element.allowed_tags should not be NULL.

I think there is something wrong with your webform.settings.yml file.

@see https://git.drupalcode.org/project/webform/-/blob/6.1.x/config/install/w...

seanr’s picture

StatusFileSize
new2.88 KB

Not sure what I should be looking for in that file. I created the worform from a standing start and had errors off the bat - wasn't anything I imported, this is a brand new start. Anyway, adjusted patch here.

jrockowitz’s picture

I am not able to reproduce this issue via a clean installation.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
phannphong’s picture

I'm facing the same problem and the patch at #6 can fix the problem.
I'm using webform version 6.2.0-beta6.

phannphong’s picture

StatusFileSize
new3.3 KB

As I mentioned in the previous comment, when the patch #6 can fix the problem. However, this patch will trgger new warning message:

Warning: Undefined array key "#allowed_tags" in Drupal\webform\Plugin\WebformElementBase->prepare() (line 813 of modules/contrib/webform/src/Plugin/WebformElementBase.php).

Therefore, I've uploaded a new patch to address this new issue.

phannphong’s picture

Status: Closed (cannot reproduce) » Needs review
jrockowitz’s picture

I think the allowed_tags is missing in your webform.settings.yml.

Please run the repair command via the UI (/admin/structure/webform/config/advanced) or Drush (drush webform:repair)

jrockowitz’s picture

Status: Needs review » Postponed (maintainer needs more info)
jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)