Incorrect RefreshView behavior

Created on 19 November 2018, over 5 years ago
Updated 14 September 2023, 10 months ago

I have a page that displays 20 views. Each of them is updated via the RefreshView command
jQuery(selector).trigger('RefreshView');
selector is always unique

When updating each view, there is duplication of requests. The number of requests doubles with each click.

After analyzing the code, I noticed that error can be in function Drupal.behaviors.ViewsAjaxView.attach

In function Drupal.behaviors.ViewsAjaxView.detach -
we have code, where we used context for delete event

  if ($(selector, context).length) {
    delete Drupal.views.instances[i];
    delete settings.views.ajaxViews[i];
  }

but for adding code don`t use context

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡§πŸ‡ΎBelarus alexdoma

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

Production build 0.69.0 2024