Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
Avoid using display mode machine name in AccountForm::form() since there could be registration forms with other form display modes (e.g. as in Registration types module).
In AccountForm::form()
in
if ($this->getOperation() != 'register') {
foreach (array('mail', 'name', 'pass') as $key) {
if (isset($form['account'][$key])) {
$form['account'][$key]['#attributes']['autocomplete'] = 'off';
}
}
}
Proposed resolution
Use if (!$register) {
instead of if ($this->getOperation() != 'register') {
.
Comment | File | Size | Author |
---|---|---|---|
#3 | avoid-machine-name_2866722_3.patch | 701 bytes | shabana.navas |
Comments
Comment #2
kpv CreditAttribution: kpv commentedComment #3
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedReplaced if ($this->getOperation() != 'register') with if (!$register).
Comment #4
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commentedHello,
Could you please describe the issue in the below manner. Describe the steps, how to replicate the issue
1)Problem/Motivation
2) Proposed resolution
Comment #5
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedComment #6
kpv CreditAttribution: kpv commented@shabana.navas thanks
Comment #10
joachim CreditAttribution: joachim as a volunteer commentedLooks good to me.
Comment #11
alexpottThere is existing test coverage of this - see \Drupal\Tests\user\Kernel\UserAccountFormFieldsTest::testUserRegistrationForm - and I don;'t think adding a module that duplicates the functionality of registration types is worth it.
Committed and pushed a324d5be36 to 8.7.x and fd4638ac0c to 8.6.x. Thanks!
Credited @kpv for reporting the issue.