"Filter webforms" not working after using browser's back button

Created on 29 August 2024, 4 months ago
Updated 6 September 2024, 3 months ago

Problem/Motivation

After searching and selecting a webform from the autocomplete input in the Webform listing page, the browser automatically redirects to the selected webform. When the user navigates back to the listing page using the browser's back button, the search input is still filled, but the result is not filtered. Additionally, clicking the Filter button does not work, causing confusion as the listing doesn't update or filter as expected.

Steps to reproduce

  • Navigate to Admin -> Structure -> Webform.
  • In the Filter Webforms section, use the input field to search for a webform name.
  • From the autocomplete suggestions, select a webform.
  • Drupal will automatically redirect to the selected webform without needing to click the filter button.
  • Click the browser's back button to return to the webform listing page.
  • Observe that the input field is still populated with the previously searched webform name.
  • Notice that the result is not filtered.
  • Click the Filter button.

Expected Result: The webform listing should be filtered based on the keyword in the input field.

Actual Result: Clicking the Filter button does nothing, and the webform listing remains unchanged.

Proposed resolution

๐Ÿ› Bug report
Status

Needs review

Version

6.3

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia adhershmnair Trivandrum

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

Merge Requests

Comments & Activities

  • Issue created by @adhershmnair
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia adhershmnair Trivandrum

    On selecting a webform from the autocomplete input, the form tag is having an attribute `data-drupal-form-submit-last=` which have the selected autocomplete. When clicking the back button the data attribute is still there but not doing anything. If we remove the data attribute from the form tag on back button, then the filter will work as expected.

  • It's trueโ€”it's definitely broken.

  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia adhershmnair Trivandrum
  • Pipeline finished with Failed
    4 months ago
    Total: 3900s
    #268549
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines regina.meow

    We are on a workshop today and my first contribution to Drupal community is to review the changes within the next hour.

  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines regina.meow

    I have done manual testing but I observed different result from the expected result.

    Specifications:
    simplytest.me
    Webform - 6.3.x-dev
    Drupal core 10.3.3
    Patch: https://git.drupalcode.org/project/webform/-/merge_requests/511.diff
    Install profile: Standard

    All the following steps were reproduced and observed.

    • Navigate to Admin -> Structure -> Webform.
    • In the Filter Webforms section, use the input field to search for a webform name.
    • From the autocomplete suggestions, select a webform.
    • Drupal will automatically redirect to the selected webform without needing to click the filter button.
    • Click the browser's back button to return to the webform listing page.
    • Observe that the input field is still populated with the previously searched webform name.
    • Notice that the result is not filtered.
    • Click the Filter button.

    Expected Result: The webform listing should be filtered based on the keyword in the input field.

    Actual Result: Clicking the Filter button will redirect to the webform previously selected from the autocomplete suggestions.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jrockowitz Brooklyn, NY

    I agree that the "Expected Result: The webform listing should be filtered based on the keyword in the input field.".

    I am not sure how we can reset, via JS, the filter value after the form is submitted via autocompletion.

  • Pipeline finished with Success
    about 7 hours ago
    Total: 173s
    #372162
Production build 0.71.5 2024