Form unresponsive when saving a scenario with out a proper value for the detail autocomplete field

Created on 8 November 2024, about 1 month ago

Problem/Motivation

Installed backstop generator on a Drupal site version 10.3.6 and PHP 8.2.2. When trying to create a new scenario if the Label field is empty or the value isn't selected from the autocomplete. Then the save button becomes unresponsive when clicked (does nothing). The console shows 2 errors every time the save button is clicked. If the entered value is not correct then the form needs to give a validation message instead of doing nothing

Steps to reproduce

  1. Install the backstop generator module on your drupal 10 site
  2. Get the scenario creating form to "/admin/config/development/backstop-generator/scenario/add"
  3. Leave the Label field empty or enter value manually with matching from the autocomplete
  4. Hit the save button

Proposed resolution

This issue is occurring as a result of 2 fields which are populated based on the selected value of the autocomplete label field. Because they are required and hidden when we try to submit the form with out them having any value. The html required validation attempts to focus on the inputs and block the form submission. But since the fields are hidden they won't be able to be focused on

  • remove required from the hidden field ('id' and 'bundle')
  • add required to the label field (since its the one that populates the 2 hidden fields)
  • add validation for the fields and show a validation message that label field needs to have value selected from the autocomplete.

)

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India dev20.addweb

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024