The Ajax pager is working well thanks to the patch https://www.drupal.org/files/issues/bootstrap_ajax_views_pager_fix-26388... however the Ajax views filter is not working at all. The page will always be forced to refresh, is anyone else experiencing this issue?
Drupal: 8.0.2
Boostrap: Bootstrap 8.x-3.0-beta2+19-dev
Comments
Comment #2
sumithb commentedSame issue for us also
Comment #3
markhalliwellMy guess is that there's something happening that's causing some JS to break. Are there any console errors present right before the page "reloads".
Comment #4
glynster commentedOn a current website I am not seeing any JS error at all: http://lacontemporarydance.org/repertory. As you can see the pager is working well without a hitch, however the filter still forces a page refresh.
Comment #5
markhalliwellThen you need to step through the AJAX request to pinpoint where this is happening. I don't have the time right now to do this. It would also help if we can pinpoint this on a fresh D8/Drupal Bootstrap install, which will eliminate any "site specific" issues.
Comment #6
glynster commented@markcarver ok tested on a fresh install (on my server), latest version of Drupal and Bootstrap Theme, problem still exists. Applied this patch to make sure the pager is working: https://www.drupal.org/node/2638816 with Ajax, still the problem exists. Firebug is not lending any errors or pointers :( Once I set Bartik 8.0.2 as the default them the filter Ajax works as it should.
Comment #7
jienckebd commentedI'm having the same problem with a recently set up D8 site using Bootstrap. My Ajax exposed filters cause the page to redirect to the URL of the actual view page. I'm embedding the page display on a different path.
Please see example: http://bryanjiencke.com/snippet
I went through the same steps as glynster. If I switch my theme to anything besides Bootstrap, it starts working.
I'm not familiar enough to walk through the Ajax request -- any help would be greatly appreciated!
Comment #8
shahgm commentedI am having similar issue where pagination using ajax works, but not the exposed filters. I have D8.0.3 and Bootstrap 8.x-3.0-beta2. I don't see any error on console or in Recent Log Message. However, i noticed warning message in console from jquery.js line 8561 as following:
it's failed in executing following line
xhr.open( options.type, options.url, options.async, options.username, options.password );Error message: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
Thanks,
Comment #9
mikefyfer commentedI think it's all related to this old issue https://www.drupal.org/node/1692198#comment-6426420 where basically views ajax is expecting an 'input' and bootstrap is providing a 'button' instead.
Haven't started debugging yet, but quick searches and quick glance - seems to be the problem.
Other relevant issue - https://www.drupal.org/node/1551534
Comment #10
mikefyfer commentedTwo things. Sorry, on a tight timeline, didn't roll patches, but here is some code that needs to be changed to get it working.
This is with:
Bootstrap 8.x-3.0-beta2
Drupal 8.0.4
1.
In bootstrap, /templates/views-view.html.twig - change
2.
In core/modules/views/js/ajax_view.js - change
And that should fix this issue.
Not sure why the views-view.html.twig is 'view-dom-id' instead of 'js-view-dom-id' and if changing that breaks anything else downstream, but I don't think so at this point, but who knows.
Relatively untested, but works for my specific setup atm.
Comment #11
glynster commented@mikefyfer I can confirm your tweak works:
Step 1 - is already updated in Bootstrap Dev.
Step 2 - once applied makes the view work as expected.
Comment #12
gcharles commented@mikefyfer
https://www.drupal.org/node/2671778#comment-10902938
I noticed this issue when using the views accordion plugin:
stable and classy both uses:
dom_id ? 'js-view-dom-id-' ~ dom_id,but bootstrap uses
dom_id ? 'view-dom-id-' ~ dom_id,This also caused the accordion to not work because it was initialized based on js-view-dom instead of view-dom-id
Would the stability of bootstrap increase if it's based on a base theme? classy or stable?
Comment #13
manuel garcia commented@gcharles this is already fixed in the dev version of bootstrap, so it will be fixed on the next release.
Core has moved to prefixing required css classes for JS with js- (see #2431671).
To the bootstrap maintaners (apologies if you're already considering this):
Stable theme is the cleanest you can have as a base theme, so none of the Drupal's standard classes are in (those are in classy). Only the stuff we didn't have time to clean up are still there, but so are they in core's templates. It's essentially a copy of core's templates when 8.0.0 was released.
So if you want to have a clean slate with bootstrap, I would suggest to base bootstrap on stable rather than no base theme. Core's markup will probably be continued to be cleaned up, so unless you want to keep track of what core does in the near future, having stable be your base theme will give you a more well, stable markup.
That said, and just to be clear, for any template you override from stable, make sure to leave in place any js- prefixed css classes in place, or you'll break js functionality.
Comment #14
markhalliwellRe: stable or classy base theme, absolutely not. Core's implementation of a "stable" base theme is just a fabricated illusion. It will become outdated, restricted and ultimately broken over time. The name "stable" is very misleading and there is actually no gaurentee that this project would work between minor core releases.
Furthermore, any customizations from "stable" would require this project to implement its own template overrides anyway. Instead of complicating matters and relying on a "base theme", I would much rather skip this extraneous step and do it ourselves.
Fwiw, the decision that lead to "stable" did not involve me and it is essentially yet another band-aid for a problem with the theme system itself.
I would recommend reading https://drupalwatchdog.com/blog/2015/8/drupal-should-use-external-front-... (including the comments).
Comment #15
markhalliwellSo it appears this is actually a core issue (with the jQuery selectors targeting only
inputelements). That being said, I think we might be able to extend/override core's JS with our own to "fix" this temporarily. I would strongly recommend creating a complimentary core issue to fix this upstream though.Comment #17
markhalliwellComment #20
sreerajp commentedHello,
This issue still exists. (version: '8.x-3.0-beta3').
The ajax filtering, ajax pagination which comes part of 'view ajax' is not working. The same view is working using the core theme 'Seven'.
The following JavaScript error is occurring while using pagination
Thanks
Comment #21
markhalliwellThere have been commits since beta3 (specially #2638816: Ajax not working for views pager). Try the latest dev.
Also, please do not re-open old issues.