Unable to Add another state due to Ajax error

Created on 18 September 2023, over 1 year ago
Updated 19 April 2024, 9 months ago

Problem/Motivation

When I try to 'add another state' on the Conditions tab the following error is shown in console - 'An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /admin/structure/webform/manage/test/element/add/checkbox?...
and in logs - Error: [] operator not supported for strings in Drupal\webform\Element\WebformElementStates::addStateSubmit() (line 589 of modules/contrib/webform/src/Element/WebformElementStates.php).

Steps to reproduce

1. Drupal 10.0.9 and webform 6.2.0-beta6
2. Create a new webform
3. Add element
4. Choose any element (for example Checkbox)
5. Go to the Conditions tab
6. Remove the default empty State
7. Click Add another state
8. Nothing happens
9. Check the browser console and 'Recent log messages'

🐛 Bug report
Status

Fixed

Version

6.2

Component

Code

Created by

🇺🇦Ukraine loon Lutsk

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

Merge Requests

Comments & Activities

  • Issue created by @loon
  • Merge request !361#3387928 Fix Add another state Ajax error → (Merged) created by loon
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    535 pass
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Pipeline finished with Success
    over 1 year ago
    Total: 1957s
    #21020
  • 🇮🇳India nikhil_110

    I have applied the MR , it is working fine and now there is no issue in adding new another state. I have attached the screenshot/video for reference.

    Step's :
    1. Setup Drupal with webform v6.2.0-beta6
    2. Enabled webform module.
    3. Go to Administration > Structure > Webform > Add webform.
    4. Add element
    5. Choose any element like Checkbox and Save
    6. Edit element and Go to conditions tab and remove the default empty state and again Ccick on sdd another state then showing error in browser console.
    7. Apply MR and clear cache, it will working fine

  • Pipeline finished with Skipped
    9 months ago
    #138602
  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 9 months ago
    536 pass
  • Pipeline finished with Skipped
    9 months ago
    #138603
  • 🇺🇸United States jrockowitz Brooklyn, NY
  • Status changed to Fixed 9 months ago
  • 🇺🇦Ukraine loon Lutsk

    @jrockowitz Thanks! Could you please add credits for me, as I described the issue and provided a solution? Thanks!

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

  • Pipeline finished with Canceled
    3 months ago
    Total: 68s
    #307492
  • Pipeline finished with Canceled
    3 months ago
    Total: 127s
    #307488
  • Pipeline finished with Success
    3 months ago
    Total: 552s
    #307493
  • Pipeline finished with Failed
    3 months ago
    Total: 425s
    #309566
  • Pipeline finished with Failed
    3 months ago
    #310023
  • Pipeline finished with Success
    3 months ago
    #310349
  • Pipeline finished with Success
    3 days ago
    Total: 198s
    #385028
Production build 0.71.5 2024