- Issue created by @netsliver
- ๐ซ๐ทFrance netsliver Chelles
I specify that by only taking the core/modules/views/js/ajax_view.js and core/modules/views/src/Controller/ViewAjaxController.php files from version 10.0.9, the pagination works again
- ๐ซ๐ทFrance netsliver Chelles
possible problem
ajax_view.js add httpMethod and pass in get instead of post
ViewAjaxController.php call $request->get instead of $request->request->get - ๐ฌ๐งUnited Kingdom longwave UK
Can you create and export a simple view that demonstrates the issue?
- Status changed to Postponed: needs info
over 1 year ago 11:46am 2 September 2023 Also what does โbrokenโ mean, technically. Are the pager buttons missing?
- ๐ซ๐ทFrance netsliver Chelles
The pager is present but not working, the view remains on page 1, the console show the good page number asked in get params.
- ๐ซ๐ฎFinland lauriii Finland
This could potentially be a duplicate to ๐ฌ Extremely long Views AJAX query string triggers 403 in AWS Postponed: needs info .
- Status changed to Closed: works as designed
over 1 year ago 5:37am 5 September 2023 - ๐ซ๐ทFrance netsliver Chelles
Problems with my projects...
A fresh install with my profile works fine...
- Status changed to Closed: cannot reproduce
over 1 year ago 10:33am 5 September 2023 - ๐ซ๐ทFrance netsliver Chelles
Temporary patch before finding out why...
I think there is still a problem with changing $request->request to $request
- ๐บ๐ธUnited States kevinquillen
Note the attached patch breaks Layout Builder. YMMV
- ๐บ๐ธUnited States kevinquillen
Nevermind - updating to 10.1.3 did that. Patch seems okay for quick fix.
- Status changed to Active
over 1 year ago 6:29pm 8 September 2023 - ๐บ๐ธUnited States kevinquillen
This is a legitimate bug. This seems to be related to long URLs and AJAX calls. The listed patch does 'fix' the issue - but otherwise Media Library either in the grid view or in the modal widget pop up will not paginate whatsoever - it will just reload the frame.
See also:
- ๐ฌ Extremely long Views AJAX query string triggers 403 in AWS Postponed: needs info
- ๐ Media browser navigation is not working Postponed: needs info
- ๐ Compress ajax_page_state Fixed
- ๐ Query string is appended multiple time after each AJAX request Needs work
- ๐บ๐ธUnited States kevinquillen
I think catch said on Slack that ๐ Compress ajax_page_state Fixed is the key to resolving all of these issues, so yes.
- Status changed to Closed: duplicate
over 1 year ago 8:15pm 8 September 2023 - ๐บ๐ธUnited States Greg Boggs Portland Oregon
Just for clarity, none of the patches in 3348789 fix the views pager yet. So, Ajax views cannot be paged in Drupal 10.1.
- ๐ฌ๐งUnited Kingdom catch
@greg AJAX pagers have test coverage in core and have been manually tested in 10.1. The compression issue fixes ssues on environments that restrict URL lengths, but otherwise it works without that.
If it's not working for you, then either there's a different so far unreported bug or more likely a contrib module involved, but it needs steps to reproduce from a clean install of core ideally.
- ๐บ๐ธUnited States Greg Boggs Portland Oregon
Thanks for the details. I Figured out the problem in my case:
- ๐บ๐ธUnited States Greg Boggs Portland Oregon
I suspect my problem is that this module has been replaced by a new core feature:
https://www.drupal.org/project/views_ajax_get โ
However, views_ajax_get has no working uninstall, and it's broken in D10 despite reporting a supported release. So, it has no notice in the upgrade report or in upgrade status.
This patch gets my Ajax pagers working again.
I'll work on replicating the problem in a clean Drupal install as soon as I can.
- ๐ซ๐ทFrance arnaud-brugnon
I don't think this a duplicate
In my case, ajax pager does not work in media library and i supposed that it's because page is define twice
#12 solve my problem while compress ajax_state does not change anything.
Btw i am using gin theme, but it's claro template so ..
- ๐ฌ๐งUnited Kingdom catch
@arnaud-brugnon several reports of this issue have turned out to be due to the facets module, could you confirm whether you have it installed, see ๐ Facets breaks all AJAX views that uses pagers even without facets Active .
- ๐ซ๐ทFrance arnaud-brugnon
Sure.
I dont not use facets module (i dont like it aha).But i do use search api module (i dont know if it matters or not)
- ๐บ๐ธUnited States Greg Boggs Portland Oregon
heh. I bet that's why my pagers are broken. Thanks for the link Catch, I'll try the facets patch. It didn't even occur to me to look into facets as a possible cause.
- ๐ซ๐ทFrance netsliver Chelles
New patch for 10.2.x - sorry the bug still exists
- ๐บ๐ธUnited States kevinquillen
Is that not related to ๐ Facets breaks all AJAX views that uses pagers even without facets Active ?
- ๐ฎ๐ณIndia abuhozaifa Delhi
Hi All,
I am using Drupal 10.0 and doing an upgrade to Drupal 10.2.3, after the update Ajax not working also when I tried to run the drush update. failed to get an update. Anyone, please suggest?
Thanks,
Hozaifa Sheikh - ๐ซ๐ทFrance arnaud-brugnon
Please provide a screenschot of your error, WE may help you.
But i dont think it s related
Hi !
I have an Image field
When I click on "Add media", everything work fine. (AJAX method:POST, +body)
Yet, when I click on 2 page, some CSS files get duplicated (AJAX method:GET, /views/ajax?ajax_form=1&_wrapper_format=drupal_ajax&media_library_opener_id=media_library.opener.field_widget&media_library_allowed_types%5Bimage%5D=image&media_library_selected_type=image&media_library_remaining=1&media_library_opener_parameters%5Bfield_widget_id%5D=field_header_image&media_library_opener_parameters%5Bentity_type_id%5D=node&media_library_opener_parameters%5Bbundle%5D=landing_page&media_library_opener_parameters%5Bfield_name%5D=field_header_image&media_library_opener_parameters%5Bentity_id%5D=61&media_library_opener_parameters%5Brevision_id%5D=602&hash=UKwOcmFbHRZjHy8K2RGIpvoJ470tuc09Sqv-J-z3q4k&_wrapper_format=drupal_ajax&view_name=media_library&view_display_id=widget&view_args=image&view_path=%2Fnode%2F61%2Fedit&view_base_path=admin%2Fcontent%2Fmedia-widget&view_dom_id=33bbb2ceb9faf3a9cfafa5af89dff0d0bd09bf0616791c92f9ac57209695b194&pager_element=0&ajax_form=1&_wrapper_format=drupal_ajax&media_library_opener_id=media_library.opener.field_widget&media_library_allowed_types%5Bimage%5D=image&media_library_selected_type=image&media_library_remaining=1&media_library_opener_parameters%5Bfield_widget_id%5D=field_header_image&media_library_opener_parameters%5Bentity_type_id%5D=node&media_library_opener_parameters%5Bbundle%5D=landing_page&media_library_opener_parameters%5Bfield_name%5D=field_header_image&media_library_opener_parameters%5Bentity_id%5D=61&media_library_opener_parameters%5Brevision_id%5D=602&hash=UKwOcmFbHRZjHy8K2RGIpvoJ470tuc09Sqv-J-z3q4k&page=1&_drupal_ajax=1&ajax_page_state%5Btheme%5D=claro&ajax_page_state%5Btheme_token%5D=idizCV_HO1lV4Z6IJOQkPtrXzf9q0EQhfp4qAw0QE6g&ajax_page_state%5Blibraries%5D=eJx9k212pSAMhjeEsoZZiSdCqsxFwgnB1ll9oxXveDvTPxieN5gPAvglpEGI4ghsz28vjGjgv1I_04ockmCSu9vxLZdzcJTMGKYhh4y2GWass3UUibsc3APZuAhM1nPNEPsEaycwlpNOkUaIXZEthjSdcEEfYIhhZOCtlxkXPJVEHrs34sW4pQwaf09yKFtyVo0g2ynuwodUiC3sk3Qa6FF-djkrVCfGJoOTsOJx-s6rkKMlRxS8CdqDCLncYREQLDek3YjoGabvlLFkSkXjfmlJi4MY_qDxuKJmvq9Xtm8Box_m4D2m9pu_mTpEfAoRza3RtoYX8B78hKIw1aGGdvLcmv0urltV22TQIhjyXBp-kqN9WsrPTmfADDI_VZkPsPe5ZcSaJqOT5tT2_TGupszE4uolt70p5ALEoVWpc2C_o3PghB7axmM1L8_kdd9jcZDx1xFcqO5CZVMLcktht48HU8wa8L3YY-3hN3zcwEK-6sVsBEXnGsle1vBV27-UfTY-ARLshj4)While debugging, I found that $ajax_page_state is NULL :/
class AjaxResponseAttachmentsProcessor implements AttachmentsResponseProcessorInterface { .. protected function buildAttachmentsCommands(AjaxResponse $response, Request $request) { $ajax_page_state = $request->get('ajax_page_state');
- ๐ธ๐ฎSlovenia useernamee Ljubljana
Well, I wouldn't mind if there'd be some kind of log message that would log if a library name is malformed such as it was the case in ๐ Fix not loading bootstrap_styles/aos.local or bootstrap_styles/aos.remote library Fixed . It would be easier to debug such occurrences.
- ๐ธ๐ฎSlovenia useernamee Ljubljana
I've re-rolled the patch for 10.2.3 version
- ๐บ๐ธUnited States Greg Boggs Portland Oregon
Have you tried updating Facet API module to the dev release to fix the bug instead of re-rolling this patch? Updating the Facet module should fix the issue for almost everyone (yes the Facet module needs a new tagged release because the current tagged release only works in Drupal 9 despite being marked as Drupal 10.
- Status changed to Needs review
9 months ago 8:21pm 27 March 2024 - ๐บ๐ฆUkraine ysamoylenko
Hello community,
Looks like I found the place where we can fix the problem.
For some reason
$request
object in/core/lib/Drupal/Core/Pager/PagerParameters.php:65
does not contain'page'
property on AJAX requests, that's why we always have current page equals to 0.The solution is simple, just add a check if the current request is an AJAX request and try to get the 'page' value from the request URI.
Please test my patch, hope it helps.
- Status changed to Needs work
9 months ago 8:25pm 27 March 2024 The Needs Review Queue Bot โ tested this issue.
While you are making the above changes, we recommend that you convert this patch to a merge request โ . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)
- last update
9 months ago 29,718 pass, 1 fail - last update
9 months ago 29,722 pass - ๐ซ๐ทFrance andypost
@ysamoylenko is there steps to reproduce? I bet there's existing test to extend
- ๐ฎ๐นItaly antonio.bertolini
Hi,
https://www.drupal.org/project/drupal/issues/3384852#comment-15523776 ๐ Ajax Pager broken after upgrade 10.0.9 to 10.1.2 Needs work
works for me. Tested also with this module as pager
https://www.drupal.org/project/views_infinite_scroll โtks ysamoylenko!
- ๐บ๐ธUnited States vlyalko
i had to add the validation for the #37 patch no work in the admin view screen as well where the 'page' value from the request URI is not present.
- ๐ซ๐ทFrance frondeau Nantes, FRANCE
Hello,
I was facing an issue on an ajax view pager, and the combo filter exposed weren't working, on Drupal 10.2.3.The comment #27 ๐ Ajax Pager broken after upgrade 10.0.9 to 10.1.2 Needs work solved the issue.
I had opened an issue about the whole issue: duplicated issue ๐ Views ajax exposed filter works only once Closed: cannot reproduceNow it works.
Thanks all.
- ๐บ๐ธUnited States JonMcL Brooklyn, NY
The Facets patch at ๐ Facets breaks all AJAX views that uses pagers even without facets Active (#25) fixes the issue for us. The fix is not yet in an official release version.
Interestingly, the patch at #44 of this issue ALSO fixes the issue.
- ๐ฌ๐งUnited Kingdom catch
@JonMcL it's because Facets was incompatible with using GET for AJAX requests, both the contrib views_ajax_get module and the core change that went in to use GET by default. You're better off with the facets patch.
- ๐ต๐ชPeru alyaj2a
Thanks! I test two patches, the number #27 ๐ Ajax Pager broken after upgrade 10.0.9 to 10.1.2 Needs work and #44 ๐ Ajax Pager broken after upgrade 10.0.9 to 10.1.2 Needs work , the two patches worked for me.
- ๐ธ๐ฎSlovenia useernamee Ljubljana
For me the patch # 27 ๐ Ajax Pager broken after upgrade 10.0.9 to 10.1.2 Needs work breaks some other views (because view_name parameter is not found).
But the underlying problem, why I'm looking into this issue is because aws is returning 403 on
/views/ajax
requests because url query is too long, so I'm looking into ways how to compress the query params length. - ๐ฌ๐งUnited Kingdom catch
@useernamee which version of core are you running?
- ๐ง๐ชBelgium kwinten-hardies Vlaams-Brabant
I have the same issue as @useernamee that the query parameter is too long. Ajax query parameters are duplicated on each request. Media browser popup with an exposed filter active and going to page 2 triggers the web application firewall error that the request entity is too long. This is also with a clean core install of Drupal 10.2.7 and besides media and media browser no extra other modules installed. I have that issue on local machine too. Browsed trough all of the issues about that but no luck finding a working patch. Please advise.
- ๐ธ๐ฎSlovenia useernamee Ljubljana
We are on 10.2.7, but we managed to resolve the issue by overriding AWS Common Rule Set.
- ๐ฌ๐งUnited Kingdom catch
@kwinten-hardies that sounds like ๐ media_library_opener leads to massive GET requests that break varnish etc. Active or ๐ Query string is appended multiple time after each AJAX request Needs work . I think we need to consolidate these issues down to one or two - the discussion is too spread out.
- ๐ง๐ทBrazil julio_retkwa Balneรกrio Camboriรบ
Thanks @vlyalko
Patch #44 worked fine for me on all my views
Drupal 10.3.1
- ๐บ๐ธUnited States rovo Delaware
#44 fixed it for me in 10.3.6.
Problem I experienced, a paginated view with Ajax, when clicking the paginations it would reload the View list, but stuck on page 1.