Needs work
Project:
Date Facets
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2014 at 12:29 UTC
Updated:
9 Apr 2019 at 00:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joseph.olstadComment #2
joseph.olstadComment #3
alamp commented@joseph.olstad thanks a lot!. It works fine with the following versions.
Comment #4
eugene.ilyin commentedHello. Thank you for patch, but how I can reproduce this problem?
Comment #5
eugene.ilyin commentedAny news?
Comment #6
zeip commentedWe also have the same problem, although I'm not yet sure why this happens. The problem is that $values is an array of unix timestamps, and the keys in $ranges are today, tomorrow etc. The patch does fix the notices, although I'm unsure if it's the correct way to solve it. We're using a bunch of Search API and Facet related modules:
Comment #7
eugene.ilyin commentedComment #8
eugene.ilyin commentedI've tried again but I can't reproduce it.
Please provide step-by-step instruction, how can I reproduce this problem and exact version of date_facets module.
Comment #9
eugene.ilyin commentedComment #10
johan den hollander commentedI know this one is has status Closed but I feel I have some valuable information.
I'm seeing a lot of errors being logged. This patch fixes that for me.
Error: Notice: Undefined index: 2017-01-01T00:00:00Z in _date_facets_api_facet_create_label() (regel 71 van /sites/all/modules/contrib/date_facets/date_facets.module).
Url:
https://www.nvao.net/actueel/reactie-nvao-op-advies-onderwijsraad-%C3%A2...
This is not an url that is normally created while a user is using the facets. When the above mentioned url is visited one can see that multiple dates are selected.
I checked the ip's in the logs and they are all from the MSN bot.
So applying this patch does not prevent this type of behavior, but at least it keeps the error logs clean.
Comment #11
sgdev commentedI can provide step-by-step instructions on how to reproduce this problem. However, I do not believe patch #1 is the right way to fix it.
We are using the following modules:
Date Facets 7.x-1.0+5-dev
Search API 7.x-1.26
Facet API 7.x-1.5+30-dev
Ajax Facets 7.x-3.7+17-dev
I have done a lot of debugging of this issue, and at least in our case, the problem is due to
search_api_facetapi_search_api_query_alterin Search API never being run when processing an Ajax request to update the date facet.I was able to trace this from
_date_facets_api_facet_create_label. The problem is this line of code, which returns an empty$ranges:The reason this is empty is due to
date_facets_get_ranges, which returns an empty value for$searchers:Diving deeper into this, the
facetapi_get_active_searchers()function in the Facet API module returns empty values:And the active searchers are added to the static variable with this code:
To add active searchers,
FacetapiAdapter::addActiveFilters()has to be called automatically by a searcher's adapter. The *only* place this is done in the code is in thesearch_api_facetapi_search_api_query_alterfunction:I have verified that
hook_search_api_query_alter()is not being called when processing an Ajax request. I have also verified that disabling the Ajax Facets module resolves the issue, the code inhook_search_api_query_alter()is run successfully, and there are no longer any watchdog errors.Seems like this might need to be moved to Search API as an issue.
Comment #12
sgdev commentedComment #13
sgdev commentedOne additional follow-up to this issue. Was investigating a problem with Ajax Facets where the date facet was disappearing when removing a selected option.
Found that the issue was due to Ajax Facets not accepting the following global facet settings, which should be valid:
Once the configuration was changed to this, it worked:
Also noticed after making this change, the Date Facets watchdog error was gone. So it seems as though both this issue and #3046720 do not support leaving "Search IDs" blank and setting "For all except the selected" as the display option.
This should work, but it doesn't. Selecting specific Search IDs fixes the problems.