Problem/Motivation
When enabling the "Override login form username title and description" setting in the miniorange_2fa module, and entering any custom string into the "Login form username title" field, the value is not saved correctly. It is always stored as the string "0" regardless of the input.
As a result, when viewing the login form, a fatal error occurs:
$string ("0") must be a string.
This makes the login form unusable.
Disabling the override option avoids the error, but we want to customize the form text to make it clearer for users. This is a blocking issue and needs to be fixed urgently.
Steps to reproduce
Navigate to Configuration > People > miniOrange Two Factor Settings.
Enable "Override login form username title and description".
Enter any string (e.g., Please enter your username) into "Login form username title".
Save the configuration.
Visit the login page.
Observe the error:
$string ("0") must be a string.
Proposed resolution
Ensure that the value entered into "Login form username title" is correctly stored and retrieved as a valid string. Prevent any unintended type casting or overwriting with "0".
Remaining tasks
Investigate the form submission handler and config saving logic.
Correct the data handling for this specific field.
Add validation to ensure "0" is not unintentionally used or stored.
Add tests to prevent regressions.
User interface changes
None.
API changes
None.
Data model changes
None.

| Comment | File | Size | Author |
|---|---|---|---|
| #7 | login-form-username-title-fix-3525717-7.patch | 476 bytes | kohei_iwamura |
| #4 | 3525717-login-form-username-title-issue.patch | 1.06 KB | sudhanshu0542 |
| #3 | screenshot 75.png | 300.2 KB | kohei_iwamura |
| #2 | screenshot 74.png | 440.59 KB | kohei_iwamura |
| screenshot 9.mov | 5.12 MB | kohei_iwamura |
Comments
Comment #2
kohei_iwamura commentedComment #3
kohei_iwamura commentedComment #4
sudhanshu0542 commentedHello @kohei_iwamura, thank you for bringing this to our attention. I have reviewed this issue and created a patch for it. Could you please apply this patch and let me know if it resolves your issue?
Comment #5
sudhanshu0542 commentedComment #6
sudhanshu0542 commentedComment #7
kohei_iwamura commentedComment #8
kohei_iwamura commented@sudhanshu0542
Thank you. The patch you provided couldn't be applied as-is, so I reviewed the contents and adjusted the relevant lines. After that, the patch applied successfully and resolved the issue. I've uploaded the updated patch file in comment https://www.drupal.org/project/miniorange_2fa/issues/3525717#comment-161....
Comment #9
sudhanshu0542 commentedI am closing this issue; the fix for this is addressed in the 5.3.0 release. Thanks, @kohei_iwamuran for your cooperation.
Comment #11
sudhanshu0542 commentedClosing this issue.