Upgrade from rc3 to rc4 breaks the Webform Submit - Ajax Error

Created on 10 November 2022, about 2 years ago
Updated 26 September 2023, about 1 year ago

Problem/Motivation

When I upgraded the module from rc3 to latest (stable) or rc4 I started getting this error on last step when I submit my form:

[{"command":"webformConfirmReload","message":"We are unable to complete the current request.\n\nDo you want to reload the current page?"}]

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡·Brazil carolpettirossi Campinas - SP

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom rviner

    This is still an issue in version 2.0.

    I can't share the webform settings but get this error with a simple multiple step form with ajax turned on and draft submissions enabled.

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    This MR seems to help but I am getting a new error when I attempt to upgrade from rc3 to the 3320565-upgrade-from-rc3 branch. The error I'm seeing is Exception: Webform submission Ajax form should never be cancelled. Only ::reset should be called. in Drupal\webform\WebformSubmissionForm->cancelAjaxForm() (line 3164 of /var/www/html/docroot/modules/contrib/webform/src/WebformSubmissionForm.php).

    Here are the steps I took:

    1. Create a fresh site using Drupal version 9.5.7 with MySQL 8
    2. Install version rc3 of the webform navigation module
    3. Import the webform yml posted in comment #12
    4. Create some submissions of that webform
    5. replace the webformnavigation module with the 3320565-upgrade-from-rc3 branch
    6. clear cache and run a drush updb
    7. edit an existing submission (the endpoint will return a 500 and you'll see the error in watchdog when you try to submit the form)
    8. Try to create a new submission
    9. Get a 500 when I try to submit the form on the final page and see the error in watchdog.
  • πŸ‡¦πŸ‡ΊAustralia nigelcunningham Geelong

    Thanks for the feedback. I've just updated the PR to fix a remaining issue I was having with the record of the errors not being retained when I moved from page to page. Now that I've got that sorted, I'll seek to reproduce and fix the issue described above.

  • Status changed to Needs review over 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia nigelcunningham Geelong

    Ok, I've debugged the issue above. The problem was that the form state 'programmed' property was being set when we run validation, but not cleared afterwards. That resulted in the confirmation page redirect not being effective.

    Please review the updated patch and I'll continue to test in the project I'm working on, too.

  • πŸ‡ΊπŸ‡ΈUnited States nixar San Antonio, TX

    We ran into this issue when updating from 1.0rc1 to 2.0.1.

    It is a major issue for us... Can the updated patch be applied against the latest stable 2.0.1 version?

  • πŸ‡ΊπŸ‡ΈUnited States greggles Denver, Colorado, USA

    @nixar does the change as of comment #14 fix the issue for you?

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    I am marking this issue as "Needs Work" because there are merge conflicts in the merge request.

  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    I added some feedback to the merge request. One major thing I see with these changes is a Drupal\Core\Entity\EntityStorageException when I try to save a webform programmatically (see comment on the MR for an example). I believe that is related to the changes in the handler's postSave function.

  • I'm having this same error on Drupal 9.5.10 with Webform Navigation 2.0.1 - happens on any form with multiple Wizard pages that uses AJAX. I'm allowing validation to be bypassed as users navigate between the pages. Really need to keep AJAX active since this form is supposed to display in a modal. Is there any version or patch that I can use right now? I did try 2.0.x-dev but that had the same issue.

  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    I've created a new MR with the other MR's changes and discovered that users can bypass validation if they navigate to the preview page (on the Wizard example form provided by the webform_examples module) and press submit.

    Here's the config for the test form:

    uuid: 7b7c5e9d-8759-43a6-be0f-167dcba96aa9
    langcode: en
    status: open
    dependencies:
      module:
        - webformnavigation
      enforced:
        module:
          - webform_examples
    third_party_settings:
      webformnavigation:
        forward_navigation: true
        prevent_next_validation: 0
        additional_error_message: ''
    _core:
      default_config_hash: pL2poJ5SN2KH-toyxJFZUhL1LfJU_jIxHdaH2nXvMng
    weight: 0
    open: null
    close: null
    uid: null
    template: false
    archive: false
    id: example_wizard
    title: 'Example: Wizard'
    description: "<p>Example of a multiple step 'wizard' webform.</p>"
    categories:
      - Example
    elements: |
      '#attributes':
        data-current-page: '[webform_submission:current-page]'
      information:
        '#title': 'Your Information'
        '#type': webform_wizard_page
        '#open': true
        first_name:
          '#title': 'First Name'
          '#type': textfield
          '#required': true
        last_name:
          '#title': 'Last Name'
          '#type': textfield
          '#required': true
        gender:
          '#type': webform_radios_other
          '#title': Gender
          '#options': gender
          '#required': true
      contact:
        '#title': 'Contact Information'
        '#type': webform_wizard_page
        '#open': true
        email:
          '#title': Email
          '#type': email
          '#required': true
        phone:
          '#title': Phone
          '#type': tel
          '#required': true
        contact_via_phone:
          '#type': radios
          '#title': 'Can we contact you via phone?'
          '#options': yes_no
      feedback:
        '#title': 'Your Feedback'
        '#type': webform_wizard_page
        '#open': true
        comments:
          '#type': textarea
    css: ''
    javascript: ''
    settings:
      ajax: true
      ajax_scroll_top: form
      ajax_progress_type: fullscreen
      ajax_effect: ''
      ajax_speed: null
      page: true
      page_submit_path: ''
      page_confirm_path: ''
      page_theme_name: ''
      form_title: source_entity_webform
      form_submit_once: false
      form_open_message: ''
      form_close_message: ''
      form_exception_message: ''
      form_previous_submissions: true
      form_confidential: false
      form_confidential_message: ''
      form_disable_remote_addr: false
      form_convert_anonymous: false
      form_prepopulate: false
      form_prepopulate_source_entity: false
      form_prepopulate_source_entity_required: false
      form_prepopulate_source_entity_type: ''
      form_unsaved: true
      form_disable_back: false
      form_submit_back: false
      form_disable_autocomplete: false
      form_novalidate: false
      form_disable_inline_errors: false
      form_required: false
      form_autofocus: false
      form_details_toggle: false
      form_reset: false
      form_access_denied: default
      form_access_denied_title: ''
      form_access_denied_message: ''
      form_access_denied_attributes: {  }
      form_file_limit: ''
      form_attributes: {  }
      form_method: ''
      form_action: ''
      share: false
      share_node: false
      share_theme_name: ''
      share_title: true
      share_page_body_attributes: {  }
      submission_label: ''
      submission_exception_message: ''
      submission_locked_message: ''
      submission_log: false
      submission_excluded_elements: {  }
      submission_exclude_empty: false
      submission_exclude_empty_checkbox: false
      submission_views: {  }
      submission_views_replace: {  }
      submission_user_columns: {  }
      submission_user_duplicate: false
      submission_access_denied: default
      submission_access_denied_title: ''
      submission_access_denied_message: ''
      submission_access_denied_attributes: {  }
      previous_submission_message: ''
      previous_submissions_message: ''
      autofill: false
      autofill_message: ''
      autofill_excluded_elements: {  }
      wizard_progress_bar: true
      wizard_progress_pages: false
      wizard_progress_percentage: false
      wizard_progress_link: true
      wizard_progress_states: false
      wizard_start_label: ''
      wizard_preview_link: true
      wizard_confirmation: true
      wizard_confirmation_label: ''
      wizard_auto_forward: true
      wizard_auto_forward_hide_next_button: false
      wizard_keyboard: true
      wizard_track: ''
      wizard_prev_button_label: ''
      wizard_next_button_label: ''
      wizard_toggle: false
      wizard_toggle_show_label: ''
      wizard_toggle_hide_label: ''
      wizard_page_type: container
      wizard_page_title_tag: h2
      preview: 2
      preview_label: ''
      preview_title: ''
      preview_message: ''
      preview_attributes: {  }
      preview_excluded_elements: {  }
      preview_exclude_empty: true
      preview_exclude_empty_checkbox: false
      draft: all
      draft_multiple: false
      draft_auto_save: true
      draft_saved_message: ''
      draft_loaded_message: ''
      draft_pending_single_message: ''
      draft_pending_multiple_message: ''
      confirmation_type: page
      confirmation_url: ''
      confirmation_title: ''
      confirmation_message: ''
      confirmation_attributes: {  }
      confirmation_back: true
      confirmation_back_label: ''
      confirmation_back_attributes: {  }
      confirmation_exclude_query: false
      confirmation_exclude_token: false
      confirmation_update: false
      limit_total: null
      limit_total_interval: null
      limit_total_message: ''
      limit_total_unique: false
      limit_user: null
      limit_user_interval: null
      limit_user_message: ''
      limit_user_unique: false
      entity_limit_total: null
      entity_limit_total_interval: null
      entity_limit_user: null
      entity_limit_user_interval: null
      purge: draft
      purge_days: 365
      results_disabled: false
      results_disabled_ignore: false
      results_customize: false
      token_view: false
      token_update: false
      token_delete: false
      serial_disabled: false
    access:
      create:
        roles:
          - anonymous
          - authenticated
        users: {  }
        permissions: {  }
      view_any:
        roles: {  }
        users: {  }
        permissions: {  }
      update_any:
        roles: {  }
        users: {  }
        permissions: {  }
      delete_any:
        roles: {  }
        users: {  }
        permissions: {  }
      purge_any:
        roles: {  }
        users: {  }
        permissions: {  }
      view_own:
        roles: {  }
        users: {  }
        permissions: {  }
      update_own:
        roles: {  }
        users: {  }
        permissions: {  }
      delete_own:
        roles: {  }
        users: {  }
        permissions: {  }
      administer:
        roles: {  }
        users: {  }
        permissions: {  }
      test:
        roles: {  }
        users: {  }
        permissions: {  }
      configuration:
        roles: {  }
        users: {  }
        permissions: {  }
    handlers:
      webform_navigation:
        id: webform_navigation
        handler_id: webform_navigation
        label: 'Webform Navigation'
        notes: ''
        status: true
        conditions: {  }
        weight: 0
        settings:
          debug: false
    variants: {  }
    
  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    This seems to be a regression that was introduced in this merge request. I wonder if we should focus our efforts on figuring out what caused the regression in those changes?

Production build 0.71.5 2024