Ajax view is not updating due to JQuery dependent once function usage

Created on 8 January 2024, 11 months ago
Updated 9 January 2024, 11 months ago

Problem/Motivation

Core module views have ajax_view.js which has function which used to refresh view to set defined values. which is used my other modules to develop functionality.

I had seen issue with views_infinite_scroll due to this and in return breaking functionality. Because what thing is required from view is returning undefined as not refreshing view and it's value.

Inside the console i can see the error:
Uncaught TypeError: $(...).once is not a function

Proposed resolution

What is there:

this.$view.once('ajax-refresh').each(function () {
      _this.refreshViewAjax = Drupal.ajax(selfSettings);
    });

What actually required:

once('ajax-refresh',this.$view).forEach(function () {
      _this.refreshViewAjax = Drupal.ajax(selfSettings);
    });

After doing these changes it's fixed and views getting updated as expected.

🐛 Bug report
Status

Closed: cannot reproduce

Version

10.2

Component
Views 

Last updated about 4 hours ago

Created by

🇮🇳India smitghelani Surat, Gujarat

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

Comments & Activities

Production build 0.71.5 2024