Auto Download causes once to not be triggered after redirect

Created on 31 August 2025, 17 days ago

Problem/Motivation

Using window.location.href = link.href results in an immediate hard navigation away from the page. This interrupts Drupal's JavaScript execution, including Drupal.once, preventing Drupal behaviors from completing fully.

Steps to reproduce

  1. Implement Drupal.once on a view (e.g., using the Select2 module).
  2. Utilize AJAX.
  3. Enable export and automatic download functionality.
  4. Click the export button and observe the issue following the redirect.

Proposed resolution

Change window.location.href = link.href; to link.click(); to prevent any hard navigation.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇯🇴Jordan Ahmad Khader

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