From 0cbd17a4ee6a58763bf763c0beb7c25a83809433 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 6 May 2022 16:29:28 +0200 Subject: [PATCH] fix: customer account create page does not work Fixes this exception which made the create account page unusable: ``` Exception: Deprecated Functionality: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/vendor/magento/module-customer/Block/Widget/Name.php on line 110 in /var/www/vendor/magento/framework/App/ErrorHandler.php:61 ``` --- app/code/Magento/Customer/Block/Widget/Name.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Block/Widget/Name.php b/app/code/Magento/Customer/Block/Widget/Name.php index 6f1b051af7465..9ad60622072e7 100644 --- a/app/code/Magento/Customer/Block/Widget/Name.php +++ b/app/code/Magento/Customer/Block/Widget/Name.php @@ -106,7 +106,7 @@ public function getPrefixOptions() $prefixOptions = $this->options->getNamePrefixOptions(); if ($this->getObject() && !empty($prefixOptions)) { - $prefixOption = $this->getObject()->getPrefix(); + $prefixOption = $this->getObject()->getPrefix() ?? ''; $oldPrefix = $this->escapeHtml(trim($prefixOption)); if ($prefixOption !== null && !isset($prefixOptions[$oldPrefix]) && !isset($prefixOptions[$prefixOption])) { $prefixOptions[$oldPrefix] = $oldPrefix;