Unable to resend email handlers when one or more handler is disabled

Created on 17 October 2023, over 1 year ago
Updated 24 October 2023, over 1 year ago

Problem/Motivation

When I want to resend a confirmation mail from a filled in webform, I het following error:

"The submitted value e_mail in the message_handler_id element is not allowed."

is this normal?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

6.2

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium bart lambert

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bart lambert
  • This is interesting. Is that the entirety of the error message?

    Can you please walk us through the entire setup to reproduce the bug?

  • πŸ‡§πŸ‡ͺBelgium bart lambert

    That's the message I get when trying to resend the confirmation mail.

    I made a form to subscribe for a dinnerparty.
    During the subcription they have to enter name, email, number of persons and then their choice for entree/main course and dessert.
    At the end the see a resume, pimped up with some twig for error detection (comparison of number of people vs total entree/main course and dessert.

    At the end they have to check a GDPR box and a math-captcha and then they send the form to the site.

    On receiving a confirmed entry, they get a confirmation mail with a summary of there demands and a twig calculates the price they have to pay.

    On constructing the form, there has been a lot of 'trail and error' and also deleting and adding elements, division into pages ....

    You can have a look here, and make a trail run if you like, I know which persons are allowed in the group some false entries can be deleted afterwards.
    https://lsvo.be/Inschrijvingen/viering-jong-gepensioneerden-2022-2024 (I hope you readers don't misuse the link to much ;-) )

    Untill here everything works fine but when I want to resend the mail (because someone has delete the original one) I get this error.

    2 screenshots added: 1 error, 1 logbook extract

  • Provide the complete config export YAML of the smallest form that exhibits the bug.

  • πŸ‡§πŸ‡ͺBelgium bart lambert

    It only happens on this form. The others are doing just fine.

  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    We just got a report of this happening too. Haven't looked into it yet though.

  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    I was able to reproduce this on a fresh Drupal 10.1.5 install with Webform 6.2.0-rc2. If there's just one webform email handler that is disabled, then you're unable to resend the mail to any handler (including the enabled ones).

    Here's the simplest webform I could create to demonstrate.

    Steps to reproduce:

    1. Create a webform
    2. Add two email handlers, but disable one
    3. Create a submission
    4. Visit the "Resend" tab for the submission
    5. Attempt to resend to either the enabled or disabled handler
    6. Observe form validation error " The submitted value email in the message_handler_id element is not allowed. "

    Attached is the webform to that demonstrates the issue as well.

    By the way, I think in Drupal 10.1 is when this form validation message changed. It used to be something like "An illegal choice has been detected. Please contact the site administrator."

  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    Here's what the resend form looks like when you have a disabled handler β†’ .

    I think the problem is that the form has two separate form elements that have the same form key "message_handler_id". One is in the top section (enabled handlers), and the other(s) are in a details elements below it (disabled handlers). Drupal doesn't handle this situation well when it's trying to validate the submitted value is part of the original allowed set of radio buttons.

    I was able to fix this problem in my testing by putting all the disabled handlers together with the enabled ones, so all the radio buttons are part of the same form key in the form array.

    The change to group the email handlers into enabled/disabled was done in πŸ› Email Handler is not working based on conditions on Resend Page Fixed .

    Maybe the solution here is to use a separate form key for the disabled handlers. But that could be tricky too because it would allow someone to select both an enabled handler and a disabled handler since it would be two independent radio fields.

    Or maybe just revert πŸ› Email Handler is not working based on conditions on Resend Page Fixed for now? The person that originally made that issue never provided feedback or any response after the proposal was shown or committed, so there's a chance they aren't even using it.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    536 pass
  • @bkosborne opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    Opened a merge request that just reverts πŸ› Email Handler is not working based on conditions on Resend Page Fixed for now

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    Thank you!

  • πŸ‡§πŸ‡ͺBelgium bart lambert

    thank you! updated to rc3 and error is gone, mails are resend without problem!!!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024