Closed (fixed)
Project:
Ajax facets
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Feb 2016 at 01:44 UTC
Updated:
4 Jun 2016 at 08:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
eugene.ilyin commentedHello
I'll try to check it in next few days.
Comment #3
eugene.ilyin commentedI can't understand the real reason of the problem, all works fine for me.
But something went wrong here:
ajax_facets.js
or here:
ajax_facets.module
I can only propose you to debug the code in these points.
Comment #4
eugene.ilyin commentedComment #5
awolfey commentedThanks for looking. I'll investigate further.
Comment #6
awolfey commentedI should have mentioned I'm using Search API and Solr. In `ajax_facets_add_ajax_js()` `$views` contains a `SearchApiQuery' array but no view.
Comment #7
shaxa commentedSame issue with me. Sometimes its not getting info at all.
And the other issue which relates to this is. If i have more then one view on page it sends the request to the wrong view which is not even a solr view.
Comment #8
szeidler commentedI was able to narrow down the problem in my test environment. I get the same error everytime, when I activate the views pager.
When I activate the pager
returns two different views. In my case:
The first one includes the paginated limited result list.
The second one the count(*) of the whole view results without pagination.
The appended '-1' for the second view results to the error, because that element is not part of the dom. When I trick the function and remove `-1` from the $display_name string in ajax_facets_add_ajax_js() facet_ajax works as designated.
I will think a little bit around it and see, if there is a non-hacky way of solving the issue.
Can you confirm, that the broken functionality is also tied to the pagination feature, in your test cases?
Comment #9
eugene.ilyin commentedThank you for investigations. I'll check it at Saturday.
Comment #10
szeidler commentedWhen calling
search_api_current_search(), the function adds an serial number, to prevent search ID collisions. The result is, that we have a $display_name in our ajax_facets module, that is not part of the DOM. I made a naive check now, that excludes all serial number view displays, because they will always lead to that wrong behavior. It's a pragmatic solution, but I'm not sure, if it is the cleanest one and doesn't create any side-effects. But it describes quite good the source of the problem.Comment #11
awolfey commentedszeidler: I don't even get any view names returned from search_api_current_search(). For me in only returns 2 SearchApiQuery objects. Are you using search api solr with the view and facet blocks both placed in a panel?
Comment #12
szeidler commentedawolfey: In my test case I used search_api_db with multiple facets placed above a views content pane in a panel. Didn't tested ajax_facets with search_api_solr till now.
Comment #13
eugene.ilyin commented@szeidler mhh, I have tried to use current search block and pager, but problem is not reproduced. Could you describe all conditions to let me reproduce this problem easily? Thanks in advance.
Comment #14
szeidler commentedUnfortunately I'm not able to reproduce my pager related issue after 2 months now. But I found a more easy use-case in which the same error occurs and can be solved by the patch in #10.
The problem occurs, when you use the same view display at least two times on the same page.
Active following modules:
Steps to reproduce:
dpm($views);to the code part from #3Both IDs will be used in the further processing and the auto-generated second one with the serial number is no actual id in the HTML DOM. For that reason the command will fail and return the error described in that issue.
If you have problem to reproduce it, I can also prepare a dump from a fresh D7 installation, to visualize you the problem.
Comment #15
sin commentedThank you for a nice module!
I have the same issue with multiple views on the page. Display id is "attachmentX_Y" in Drupal.settings but "page" in actual DOM.
The temporary workaround is to override Drupal.settings.facetapi.display_name for example in hook_preprocess_html.
The solution may be the separate option to select view and display manually in module settings.
Comment #16
eugene.ilyin commentedHi all.
Seems I have resolved it in issue #2464823: Fix for use with multiple Search API View Displays.
Any testing are appreciated.
Comment #17
eugene.ilyin commentedI hope that it will work. If somebody will have problem with it, please open new issue, because this issue is already big.
But would be nice to relate the new issue with this issue.