Useradd task gives a deprecation notice for the password confirmation field
Deprecated function: Function create_function() is deprecated in HTML_QuickForm_Rule_Compare->validate() (line 87 of ...\vendor\civicrm\civicrm-packages\HTML\QuickForm\Rule\Compare.php).
HTML_QuickForm_Rule_Compare->validate(Array, '===') (Line: 158)
HTML_QuickForm_RuleRegistry->validate('compare', Array, NULL, 1) (Line: 1580)
HTML_QuickForm->validate() (Line: 591)
CRM_Core_Form->validate() (Line: 126)
CRM_Core_StateMachine->perform(Object, 'next', 'Next') (Line: 43)
CRM_Core_QuickForm_Action_Next->perform(Object, 'next') (Line: 203)
HTML_QuickForm_Controller->handle(Object, 'next') (Line: 103)
HTML_QuickForm_Page->handle('next') (Line: 352)
CRM_Core_Controller->run() (Line: 35)
CRM_Contact_Page_View_Useradd->run(Array, NULL) (Line: 313)
To reproduce:
- Use 5.36 or earlier, or you'll see it again after https://github.com/civicrm/civicrm-core/pull/20274.
- View a contact.
- From the actions menu choose Create User Record.
- Fill it out and save.
It's deprecated in php 7.2 and will be removed in php 8.
There's two obvious ways to fix this:
- Just doing a quickie search, this form is the only place the quickform "compare" rule is used. So just replace it with a local formRule that just does "is it equal".
- Patch quickform to update this rule.
Either way is about the same amount of work I think, so leaning towards choice 1.