Problem/Motivation
I installed this module and, when try to change the configurations, I received the follow error:
The website encountered an unexpected error. Please try again later.
Error: Call to undefined function Drupal\force_password_change\Form\drupal_set_message() in Drupal\force_password_change\Form\AdminForm->submitForm() (line 364 of modules/contrib/force_password_change/src/Form/AdminForm.php).
Drupal version: 9.2.0
Steps to reproduce
1) Go to Administration -> Configuration -> People -> Force password change
2) Click in Submit button
3) You will see the error message
Proposed resolution
Change the deprecated function drupal_set_message() to \Drupal::messenger()->addMessage
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
larisse commentedI create this patch to solve this problem.
Comment #3
larisse commentedJust replacing the deprecated function in all files of module, not only in AdminForm.php, like in patch #2
Comment #4
hmendes commentedHello, I can confirm the problem reported and that the patch from #3 fixed the issue.
Steps:
Changing this to RTBC.
Comment #6
larisse commentedComment #8
jds1Hi there! This bit us in a prod D9 site where a user was unable to log in. Patch totally fixes it. Could we please get a stable release that includes this update? Thanks!
Comment #9
mlncn commentedDitto on the release!
Using
composer require 'drupal/force_password_change:2.0.x-dev@dev'ourselves for now.Maybe even #2922398: Unable to reset my password could be brought in right before that stable release, as a treat? :-)