Problem/Motivation
A Depecated function error is thrown for the file WebFormHtmlEditor.php
Deprecated function: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\webform\Element\WebformHtmlEditor::getAllowedTags() (line 203 of modules/contrib/webform/src/Element/WebformHtmlEditor.php).
Steps to reproduce
Go to the webform and try and add content using the gutenberg editor
Proposed resolution
To fix the issue you need to create a patch on line 203
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | pregmatch-webformHtmlEditor.patch | 486 bytes | alexdrupaldev |
Issue fork webform-3445749
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
alexdrupaldev commentedComment #3
cilefen commentedCan you get us the stack trace do we can better understand why Gutenberg doesn’t send the proper type?
Comment #4
jacqui1811 commentedThe patch (#2) worked and removed the Deprecated function alert for me.
Don't know if any unforeseen issues will come out of it but all working okay for now.
Comment #7
berdirGot a similar error in webform/src/Element/WebformElementAttributes.php:117
Comment #9
jrockowitz commentedThis seem safe to merge
Comment #13
thhomas commentedThere is still some places where the `preg_split` function is triggering an error in the Webform module because 2nd parameter is not of type string.
https://git.drupalcode.org/project/webform/-/blob/6.3.x/src/Plugin/Webfo...
https://git.drupalcode.org/project/webform/-/blob/6.3.x/src/Element/Webf...