PWaddict Posted August 19 Posted August 19 Hello! I'm suddenly getting the following error on my first login to admin, when installing/uninstalling a module and when checking for new module updates through ProcessWireUpgrade module. PHP Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in C:\laragon\www\mysite\wire\core\LanguageFunctions.php on line 232 The line 232 of wire\core\LanguageFunctions.php has this: if($encode) $value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $encode === true); And when this error happens, the main admin menu links Pages, Setup, Modules, Access are gone. EDIT: The following code on my template for creating user is causing that weird issue: // Check if order is paid if($order->pad_paid) { // Save new user if($user->isGuest()) { $u = $users->add($order->email); $u->email = $order->email; $u->pass = $order->pass; $u->ip_address = $order->pad_ip_address; $u->addRole("login-register"); $u->save(); // Save user to the order page $order->setAndSave([ 'pad_user' => $u->id ]); } }
poljpocket Posted August 19 Posted August 19 Have there been any changes to the PHP version running on your host? What PW version is it? What PHP version?
PWaddict Posted August 19 Author Posted August 19 It's on localhost with ProcessWire 3.0.251 and PHP 8.3.9. I've imported yesterday's db backup and the problem is gone. I did 2 things today, creating a custom process module and creating a user from api. The module doesn't cause any issue so I repeated the process of creating a user from the api and it seems that is causing the issue. Why the following code is causing that weird issue??? // Check if order is paid if($order->pad_paid) { // Save new user if($user->isGuest()) { $u = $users->add($order->email); $u->email = $order->email; $u->pass = $order->pass; $u->ip_address = $order->pad_ip_address; $u->addRole("login-register"); $u->save(); // Save user to the order page $order->setAndSave([ 'pad_user' => $u->id ]); } }
PWaddict Posted August 19 Author Posted August 19 Ok found why this is happening. The code is fine as I was I able to create a user from a different template and there was no problem. I'm creating a user when order through Padloper (v1) is completed. Few days ago I've renamed the page name "padloper" from the related admin page that displays the orders and since that name is hardcoded on Padloper module that's why I was getting that weird issue.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now