Problem/Motivation
Drupal 9.3.15 has an issue with Deprecated function: htmlspecialchars() with combination of PHP 8.1.4
Steps:
1.Go to Structure > Taxonomy
2. Add new vocabulary
Following warning appears :
Deprecated function: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Html::escape() (line 424 of core/lib/Drupal/Component/Utility/Html.php).
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | trim.6707D8C3-9061-45E6-B1D2-757F23393AA6.MOV | 5.64 MB | coaston |
Issue fork drupal-3283755
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
cilefen commentedPlease get a stack trace.
Retitling because the function is not deprecated.
Comment #3
coaston commentedI just added video.
Drupal 9.3.15
Php 8.1.4 memory limit 256M
Linux red hat 2.4.6 and mysql db 5.7.38
Comment #4
cilefen commentedWe need a stack trace not a video. ;-)
Can you confirm this is reproducible by installing Drupal Core alone? I suspect a contributed module. A stack trace will reveal that.
Comment #5
coaston commentedHi cilefen, can you guide me?
I tried to insall devel module but the whole site crashed, so any other idea?
I do have same issue on my test and prod enviroment so havent tried on clean drupal but I am sure when i had drupal 9.3.15 and php 7.4+ there was not any error. It started when i upgraded php to 8.1.4
But i do have 2 other modules installed which work with taxonomy so wil try to unistall them to see the difference.
Comment #6
coaston commentedI just unistalled both referenced modules and still the same issue.
So can you provide the way how can I enable stack trace please?
Comment #7
cilefen commentedI don't know what you mean by "the referenced modules".
Can you reproduce the deprecation warning starting by installing Drupal or at https://simplytest.me?
Comment #8
coaston commentedHi Cilefen,
Finally i was able to install "Devel" module with all required libraries so now it works and does not crash. Hence I was able to read backtrace log that the problem was caused by another module : https://www.drupal.org/project/simplify
Once I uninstalled it. The error disappeared!
Thank you for your time. I learned a lot today thanks to you.
Comment #9
cilefen commented