Views exposed form resets unique ids and breaks AJAX forms

Created on 24 February 2017, over 7 years ago
Updated 15 August 2024, 3 months ago

Hi!

I have a website with 3 forms on a page:

  • an ajax enabled form
  • the user login form
  • a views exposed form

The login form and the ajax form have buttons with the id edit-submit which are perfectly changed to edit-submit and edit-submit--2 when the views exposed form is not on the page. After putting it there I found that both ids where the same which lead to unexpected behavior.

Digging into the code showed that in \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase::renderExposedForm on line 121 the form state is set to be always processed via setAlwaysProcess(). While building the form this setting triggers a call to \Drupal\Component\Utility\Html:: resetSeenIds().

Since this seems to happen in between the 2 form builds 2 submit buttons with the id edit-submit are generated.

I don't know how to fix this issue, but there is another issue regarding the use of setAlwaysProcess() in the exposed form.
Maybe someone has an idea how to fix this.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 3 hours ago

Created by

πŸ‡©πŸ‡ͺGermany manuelbitmade

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 States Kristen Pol Santa Cruz, CA, USA

    Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.

    As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)". This issue was marked "Postponed (maintainer needs more info)" almost a year ago and there has been no activity since that time.

    Since we need more information to move forward with this issue, I am keeping the status at Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • Status changed to Closed: cannot reproduce 3 months ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    This should have been closed back in #9

Production build 0.71.5 2024