- Issue created by @wahavi
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
The module sends an email and needs a subject
Can you elaborate on the use case for hiding the subject?
- ๐ท๐บRussia Alezu
I confirm that hiding the subject causes a fatal error when submitting the form. I don't think we should look for any use cases since this can only be done in the form display settings page. I have encountered this error at least twice and each time I spent a lot of time trying to find the source. We should have some workaround, like additional validation or a default value for the subject.
- ๐ฎ๐ณIndia AditiVB
i am not getting any error even if subject filed is disabled. Do let me know how you are sending email ?
- ๐ท๐บRussia Alezu
I encounter the error only for anonymous user, debug_backtrace() returns the source of the error like something like "t('@name anonymous', ['@name' => NULL])". As for the current case I do not see any additional mail modules installed and think that finally it is sent by ordinary mail() function.
- ๐ญ๐บHungary wahavi
Thank you very much for your answers.
I think users who send messages through a contact form hate filling useless fields, like the subject field. At least this is my own experience. That is why I always disable subject field (and I always did it), and it was not a problem until upgrading to drupal 11. It was my fault that I did not check the contact form then, so there could have been some clients who faced with the error page since then.
I did not change anything other than uploading the new core and vendor directories. I use the default core email sending mechanism, no other modules (like SMTP or mime mail or such). - ๐ณ๐ฟNew Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies โ . Restored the issue template. The issue template is used to track progress and various tasks on an issue.
- ๐ฎ๐ณIndia Ishani Patel
ishani patel โ made their first commit to this issueโs fork.
- Merge request !11668Issue #3515019: Contact form throws error on submitting โ (Open) created by Unnamed author
- ๐ฎ๐ณIndia Ishani Patel
Hello @wahavi
I've followed the above issue steps as you mentioned and got the same error when I disable a subject field.
I resolved that issue and raised an MR
Please check and review.Thanks
- ๐ฎ๐ณIndia sdhruvi5142
Hi
I've applied MR!11668 and verified on Drupal version on 11.0.x and it is working as expected.Testing Steps:
1. Installed Contact Module
2. Created a webform and disabled Subject field
3. And oberved the change there.Testing Result:
After applying the MR the, when user disable the subject field, the form is getting submitted succesfully without error. Attaching SS for reference. As MR have some error so keeping in Needs review status. - ๐บ๐ธUnited States smustgrave
Should have a test case showing the issue.
Also issue summary is incomplete.
- ๐ท๐บRussia Alezu
I am not sure we should deal with this problem in FormattableMarkup but as soon as converting to string already present there let it be... Please review my addition to the tests.