Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm not sure if it's limited to my setup but so far neither dev for the beta work. Whenever I click "add a new date range" with or without JS enabled I get the same thing. Nothing. The ajax request returns empty to errors and the non js version just reloads the same page. I am going to look more into this module on Sunday but if anyone has had this issue and knows the solution that'd be great.
Also does this module have the ability to do custom date ranges and is there a reason beyond it not being needed? Because that is something I would like to put in.
Comment | File | Size | Author |
---|---|---|---|
#13 | 2156193_13_not_allowing_me_to_add_new_facets.patch | 21.51 KB | florisg |
#9 | 2156193_not_allowing_me_to_add_new_facets.patch | 21.99 KB | codium |
Comments
Comment #1
Daemon_Byte CreditAttribution: Daemon_Byte commentedthink this might be a facetapi error. https://drupal.org/node/2122119
Comment #2
eugene.ilyin CreditAttribution: eugene.ilyin commentedIt's actually? Seems #2122119 is solved.
Comment #3
Daemon_Byte CreditAttribution: Daemon_Byte commentedyes it was an error in facetapi and that was fixed.
Comment #4
codium CreditAttribution: codium as a volunteer commentedStill not work for me. I've tried to apply patch from #1 but already in code...
Comment #5
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commented@codium, can you provide more info please? Versions, conditions, symptoms?
Comment #6
codium CreditAttribution: codium as a volunteer commented@eugene.ilyin
More details:
Date Facets: 7.x-1.0
Facet API: 7.x-1.5
Ctools: 7.x-1.9
Search API: 7.x-1.16
What I've done:
Add: date field (single value - birthday) to index.
Enable Date Facets
Select Date Range with checkboxes as widget type
Configure two date ranges
Set Operator to 'OR'
In Sort options select only 'Display value'
Export current settings via Features
Then I've tried to add another date range, but click action on button 'Add a new date range' causing only page reload
I removed date field from index, and repeated above steps. Old date ranges are shown with no possibility to add new one.
Comment #7
codium CreditAttribution: codium as a volunteer commented@eugene.ilyin any updates?
Comment #8
djdevinI can't configure the date ranges either. Running dev versions of everything. Will try to investigate.
Comment #9
codium CreditAttribution: codium as a volunteer commented@eugene.ilyin
I've read code. IMO add new date range cannot work.
I've created a patch. Seems to work, but new date range is not saved. Can you review and improve it?
Comment #10
codium CreditAttribution: codium as a volunteer commentedComment #11
f0ns CreditAttribution: f0ns commentedI have the same issue, I'll try to debug this asap and let you know when I found a solution. If anyone else has a quick fix for this issue i'll be glad to test it.
UPDATE: couldn't get this to work, i'll have to investigate this further.
Comment #12
f0ns CreditAttribution: f0ns commentedI think I found the issue, atleast it got me to add some more options:
in file lib/DateRangeWidget.php I've put $form_state['add_new_range'] = FALSE; in comment on line 218:
Comment #13
florisg CreditAttribution: florisg at 040lab commentedConfirmed patch #12 works, re-rolled against git. with fuzz 1 (newline EOF)
Comment #14
florisg CreditAttribution: florisg at 040lab commentedit does allow UX to but does not seem to store or show after Clear Cache (Using Facetapi 1.x-dev)
needs refactoring
Comment #15
pixelpreview@gmail.com CreditAttribution: pixelpreview@gmail.com commentedI confirm, I have the same result, I use the patch I create new date fields and after save, all of my new date fields disappeared on the edit page.
I can't change the already configured date fields by the module. When I change the settings, nothing saved.
Comment #16
MickL CreditAttribution: MickL commentedI can confirm that it is not possible to add a new date range. That is kind of critical, because after deleting all date ranges, it wouldnt be possible to have any date range and the module doenst work anymore.
Comment #17
judapriestIf you are using features, you can save tour facet and the date range.
And then, you can modify them.
Comment #18
oldspot CreditAttribution: oldspot as a volunteer and at Zoocha commentedI'm facing the same issue and I have started debugging the whole form build process with Xdebug to see what it's trying to do.
I noticed the whole of "settingsForm" function in the class "Drupal_Apachesolr_Facetapi_Widget_DateRangeWidget" gets called twice so i started following the form calls before it reaches that.
Basically in the file facetapi.admin.inc in the facetapi module, when all the widgets get built to be displayed in the facetapi_facet_display_form function, the
$plugin->settingsForm($form, $form_state);
gets called once forDrupal_Apachesolr_Facetapi_Widget_DateRangeCheckBoxesWidget
and once forDrupal_Apachesolr_Facetapi_Widget_DateRangeWidget
, and since the checkbox one extends the normal one they both use the same "settingsForm" function.For some reason the whole 'date range' form gets 'replaced' by the 'date range with checkboxes' one, instead of having two separate forms technically.
I noticed that if I change for example the text "Past year" to let's say "Past years" in the 'date range' form, and then switching the "Display widget" to 'date range with checkboxes' that whole settings form stays exactly the same, which it shouldn't really since they should really have different settings forms since they are different widgets.
This is actually the reason why the "Add new date range" doesn't work - the form gets called once for the 'date range' settings form and then
$form_state['add_new_range'] = FALSE;
gets run. The second time the settings form is called for 'date range with checkboxes' that 'add_new_range' is not TRUE any more so it doesn't add the new line to add a new date range.Technically commenting out
$form_state['add_new_range'] = FALSE;
makes it work (even after clearing caches unlike #14 and #15) but it's just a 'work around' - does not fix the fact that technically 'date range' and 'date range with checkboxes' have the same form and cannot have different settings.Looking at other widgets though I see that the ones that extend other classes all face the same issue, so maybe this is more of a 'facetapi' module issue?
Sorry for the long 'brain dump' but wanted to write down all the debug findings in case it helps others.
Comment #20
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commented@oldspot is right.
I have corrected this error. For me it works, but would be nice if somebody will test it.
Comment #21
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commentedLet's decide it as fixed. If it will not work, please create new issue.
Comment #22
Bohus UlrychHello @eugene.ilyin
on my side this fixed my issues (latest dev version 2016-May-26)
Thank you!