- Issue created by @FrankieD3
- π¬π§United Kingdom scott_euser
Can I check if you are on the 8.x-2.x dev branch and you have https://www.drupal.org/project/viewsreference/issues/3396530 β¨ Views reference results in 414 if many options set and ajax used Needs review in your code? I think it might be related, spotted the regression, test coverage not good enough, just working on solution now.
- π¬π§United Kingdom scott_euser
If so I think π Regression introduced in "Views reference results in 414 if many options set and ajax used" Active might solve it for you. Just improve test coverage for that.
- πΊπΈUnited States FrankieD3
I am on the suggested 8.x-2.0-beta8 branch. I've given the patch a try, but as expected, it didI am on the suggested 8.x-2.0-beta8 branch. I've given the patch a try, but as expected, it did not apply. not apply.
- π¬π§United Kingdom scott_euser
I just tried to reproduce this and my pager seems to work fine. Any JS console errors or anything in /admin/reports/dblog for example?
- πΊπΈUnited States FrankieD3
No, none! It's a strange case. I can render the same block containing the view on a page multiple times through multiple methods, and the only one NOT to receive the AJAX behavior is the one rendered through Layout Builder.
I'm not sure what else I can provide, but I will gladly give any information I can. Perhaps this is a core issue, or an issue elsewhere?
All I can glean from this is that the Once call forajax-pager
isn't running on that specific view. Apologies for not having much else to go on! - πΊπΈUnited States FrankieD3
Revisiting my issue this week, I believe it goes deeper than this module.
I'm a bit befuddled, especially given you can't reproduce it. It seems that any view I attempt to render through a content block placed with Layout Builder does not attach the associated data needed within#attached
.
Since you can't reproduce the issue, where do you suggest I go from here? - π¬π§United Kingdom scott_euser
For anyone to be able to take action you'd need to show doing it in a clean drupal 10.3 or 11 install with the latest version of the module(s) in question. Would suggest you start with e.g. just Core and this to limit any side effects. Others won't be able to narrow down your issue otherwise.
If you are able to code yourself, if you are confident it's this module, try comparing the viewsreference data in layout builder vs not layout builder in the viewsreference.module file's pre render and pre view methods e.g. with devel to see if you can spot the difference. Try also the two field formatters provided, maybe seeing if one or the other formatter solves (e.g. swapping in manage display), and again you could check whether the data there differs between working and not working.
- πΊπΈUnited States FrankieD3
I was able to reliably reproduce the issue through a fresh ddev install. Hopefully this will be a bit clearer than my first attempt.
Leaving out the standard steps to create a new ddev Drupal install, I spun it up with the following config:
ddev config --project-type=drupal --php-version=8.3 --docroot=web ddev composer create drupal/recommended-project:^10 ddev composer require drush/drush drupal/viewsreference:^2.0@beta
Most of what I had mentioned in the IS was pre-installed, so that cuts down on installs.
- Install Layout Builder and Views Reference Field
- Create four Article nodes, only populating the title fields
- Create a content view with no filters, enable a full pager with two items per page, and enable AJAX
- Create a block type and add a Views Reference Field, leaving the default settings
- Navigate to
/admin/content/block
and add a content block, referencing the previously created AJAX view - Create a new vocabulary and enabled Layout Builder for the default display
- Manage the layout of the vocabulary, adding a new section containing the previously created block
- Add a term to the vocabulary, only populating the title
- Navigate to the new term and use the rendered view's pager
The view uses the standard non-AJAX pager, loading a new page with the
page
query parameter appended to the URL.Following these steps I was able to reliably reproduce the issue multiple times.
My next step will be digging through the hooks you mentioned in viewsreference.module.
Thank you for your patience!
- Status changed to Closed: works as designed
5 months ago 12:47pm 17 July 2024 - πΊπΈUnited States FrankieD3
This does appear to be a core issue. It just so happens that Views Reference Field is what exposed it. Continuing in #3461890 π AJAX views pager not working when rendered through layout builder Active Thanks!
- π¬π§United Kingdom scott_euser
Interesting one, good sleuthing! Will follow that issue as I'm curious where it leads.