Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Jan 2017 at 15:06 UTC
Updated:
11 Jun 2019 at 17:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nielsvoo commentedComment #3
drunken monkeyDo you maybe have caching enabled for the view? Try with caching set to "None".
Comment #4
nielsvoo commentedThanks for the tip but its already off.
Other suggestions?
Niels
Comment #5
drunken monkeyNot really, sorry. I can't reproduce the problem, either – for me, search views work fine with AJAX turned on, too.
Do you maybe have some other modules enabled that could influence this? Try turning those off one by one to see if it starts working at some point.
Does it maybe work just for anyonmous or registered users?
Comment #6
azovsky commentedI have an issue in a views where set the AJAX option as " Use AJAX: Yes".
Drupal 8.6.15; Search API 8.x-1.x-dev updated 21 Apr 2019 at 14:38 UTC; search_api_solr 8.x-2.7.
Used a contextual filter by date field.
The site is down with a message:
Error: Call to a member function addCondition() on null in Drupal\search_api\Plugin\views\argument\SearchApiDate->query() (line 98 ...Looks like when enabled AJAX then
$this->query->createConditionGroup()in web\modules\contrib\search_api\src\Plugin\views\argument\SearchApiDate.php not working. New conditions not created.Comment #7
drunken monkeyI don’t think that’s the root cause of your problem.
The problem rather seems to be that the Views query plugin encountered some issue earlier that caused it to be aborted. In that case,
createConditionGroup()will returnNULL, causing this problem. (Seems we already encountered and fixed this for the fulltext search filter, back in #2939085: Views, search fails when user searches for space (patch attached), but missed it for some other spots.)So, that fatal error in your case only masks the real problem. (Apparently, some other problem regarding your view and AJAX. I, for one, can’t reproduce this. Nothing to do with the date contextual filter, in any case.) Nonetheless, it should of course not happen, we should properly guard against that. For that, I have two patches to propose, both of which would take care of the problem in different ways. (Personally, I’d prefer
views_query_always_create_condition_group, but I’m open to other opinions there.)Once you apply either patch and try again, you should see the real error that keeps your view from working with AJAX.
Comment #8
azovsky commentedThank you @drunken-monkey! I will try patches!
So far I have refused to use any contextual filters in my View. Instead, I programmatically read/add required parameters.
Comment #9
drunken monkeyCommitted.