Some error upgrade 5.1.0 to 5.1.1

My software
My Mautic version is: 5.1.1
My PHP version is: 8.1
My Database type and version is: MySql

Hi everyone, I’m new to the forum and to using mautic. I need some help if possible. I updated from version 5.1.0 to 5.1.1 and with much anxiety I had to find a workaround to a problem that was causing me errors 403 and 500. Looking at the logs I noticed that the problem was due to this error: var/cache/prod/ContainerO7jGfxO/getMautic_User_FormGuardAuthenticatorService.php on line 36 and exactly 7 expected {“exception”:"[object] (ArgumentCountError(code: 0): Too few arguments to function Mautic\UserBundle\Security\Authenticator\FormAuthenticator::__construct(), 6 passed in /home1/infludea/public_html/emails.delora.it/ … 36 and exactly 7 expected at /home1/infludea/public_html/emails.delora.it/app/bundles/UserBundle/Security/Authenticator/FormAuthenticator.php. I modified the FormAuthenticator.php file around line 50 commenting this parameter “// private PasswordStrengthEstimatorModel $passwordStrengthEstimatorModel” and the checkCredentials function always in the same file around line 152 “if ($valid) {
// if (!$this->passwordStrengthEstimatorModel->validate($credentials[‘password’])) {
// throw new WeakPasswordException();
// }
}”
Now it’s back to working
I wanted to ask you experts what could have happened and if my workaround can be a solution. Thanks for the answers.