I have some numeric exposed filters and the operation is "is between". Views prints out two text boxes with the label above the first one, the second with a label of "And". However, when I add it to the Secondary section, the "And" label appears, but the main label does not appear.
Looking at the view object, it seems the label for this hybrid field is in the $form['#info']
or something like that and not directly attached to the first, minimum numeric field. So it seems Better Exposed Filters would have to add some code to bring these labels for the compound exposed filters along into the Secondary area.
Comment | File | Size | Author |
---|---|---|---|
#12 | 2018173.patch | 818 bytes | Vali Hutchison |
Comments
Comment #1
dandaman CreditAttribution: dandaman commentedHere's some rather hackish code that I did to fix it:
I added this code to around line 1270, just before this line:
EDIT: Oh yeah, that's in
better_exposed_filters/better_exposed_filters_exposed_form_plugin.inc
.Comment #2
coolestdude1 CreditAttribution: coolestdude1 commentedI ended up solving the issue based off of the code above, here is my code below.
Line No. 1364 of BEF 7.3-beta4 file: better_exposed_filters_exposed_form_plugin.inc
Code comes before: '$secondary[$identifier] = $form[$identifier];'
When reviewing the code I did not find it necessary to affect the 'max' field because the label was already 'And'. So I can simply change my filter to say 'Post Date Between' which makes more sense. Read out completely it should be 'Post Date Between x And y'.
I do not believe the above is the proper way of dealing with the issue (hence no patch), ideally better exposed filter should detect the date picker option and allow the editing of the two entry box labels.
Comment #3
Niremizov CreditAttribution: Niremizov commentedThe same thing happens with date fields. To fix it - after 1374 line of code insert (better_exposed_filters_exposed_form_plugin.inc):
Comment #4
Niremizov CreditAttribution: Niremizov commentedAnd in addition to comment #3 - when date fields inside secondary options, secondary options not collapsing after applying primary options. I have fixed it with code below:
Comment #5
Niremizov CreditAttribution: Niremizov commentedComment #6
mikeker CreditAttribution: mikeker commentedIssue queue cleanup... My apologies for taking so long to address this issue!
I've changed things so that in-between filters (really, any filter that has more than one child form element) show labels correctly.
Comment #9
Jaquesante CreditAttribution: Jaquesante as a volunteer commentedSorry if this is the wrong status, but Date field labels are unfortunately still not showing in the secondary section.
Thanks for a great module!
Comment #10
tsega CreditAttribution: tsega commentedThis issue is still there, I'm using version 7.x.3.2.
Comment #11
demonde CreditAttribution: demonde commentedYes, the patch from mikeker is missing the line
$secondary[$identifier]['value']['#title'] = $form['#info'][$filter_key]['label'];
after
$secondary[$identifier]['#title'] = $form['#info'][$filter_key]['label'];
Comment #12
Vali Hutchison CreditAttribution: Vali Hutchison commentedCan confirm that #11 above fixes the missing label for date fields in the secondary section. See patch for 7.x-3.4
Comment #13
Neslee Canil PintoHi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Closing this as Closed(wont fix).