Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yiiGridView pagination stops working on ajax request #4570

Open
Skalin opened this issue Oct 26, 2024 · 2 comments
Open

yiiGridView pagination stops working on ajax request #4570

Skalin opened this issue Oct 26, 2024 · 2 comments

Comments

@Skalin
Copy link

Skalin commented Oct 26, 2024

The pagination and or filtration of grid views stops working upon trying to filter using Ajax request. This is caused by an updated jquery-bbq library. The library fails in "qs.HasOwnProperty" method.

What steps will reproduce the problem?

Trying to refresh, paginate or filter the Yii gridview causes javascript to fail. This is done even before any AJAX request is done.
Simple call for: $("#grid-view").yiiGridView("update", {url: refreshURL}); will cause the bug.

What is the expected result?

The grid view is properly updated and the ajax request is processed.

What do you get instead?

Error response:

index:461 Uncaught TypeError: qs.hasOwnProperty is not a function
	at index:461:12
	at Function.<anonymous> (jquery.min.js:4:17819)
	at Function.each (jquery.min.js:2:2881)
	at g (jquery.min.js:4:17785)
	at Ub (jquery.min.js:4:17922)
	at Function.ajax (jquery.min.js:4:21073)
	at HTMLDivElement.<anonymous> (jquery.yiigridview.js:355:21)
	at Function.each (jquery.min.js:2:2881)
	at n.fn.init.each (jquery.min.js:2:846)
	at n.fn.init.update (jquery.yiigridview.js:260:16)

More info - the issue occurs in the function ajax.preFilter:

$.ajaxPrefilter(function (options, originalOptions, jqXHR) {
	var qs = $.deparam.querystring(options.url);
	if (qs.hasOwnProperty("ajax") && qs.ajax == "grid-view")

Additional info

Q A
Yii version 1.1.30
PHP version 8.2
Operating system Debian
jQuery version v1.12.4 (Yii packed one)
@Skalin
Copy link
Author

Skalin commented Oct 26, 2024

The temporary solution is to revert back to package 1.1.29.
There might be a possibility to update jquery to newer versino using client script, but it has to be tested which version will work properly.

@marcovtwout
Copy link
Member

marcovtwout commented Oct 28, 2024

@kevin-foster-uk It seems #4563 has caused a regression, could you take a look at this?

@Skalin Could you point out exactly where you think the update jquery-bbq has caused this? I don't see it in your stack trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants