Hi,
I tried to add Office Hours in the views' filter and I am not having much luck at the moment.
- Office Hours: Day filter is working fine (i can select day)
- Office Hours: Start Hours Filter is not working at all... When I tried to add it's giving me an error message:
"Fatal Error: Call to undefined function _create_hours_arr() in *************/includes/mass_times_handler_filter_hours.inc on line 107""
I did try to uncommented this and another error message displayed.
warning: Invalid argument supplied for foreach() in ******/includes/form.inc on line 1434.
and no time displayed at all.
- Office Hours: End hours filter is not working as well
I got this error message:
Error: handler for node_data_field_oh > field_oh_endhours doesn't exist!
Has anyone managed to make exposed filter working for either start time or end time? I just need one to work :)
Please help and thank you.
Comments
Comment #1
HippoOnDiet commentedI think I have managed to fix this error myself, not sure if it's working or not as I haven't tried to put some nodes to try.
Anyway here is what I do:
I updated $opt on /includes/mass_times_handler_filter_hours.inc on line 107 to
$opt = array(0 => t('12:00 AM'), 100 => t('1:00 AM'), 200 => t('2:00 AM'), 300 => t('3:00 AM'), 400 => t('4:00 AM'), 500 => t('5:00 AM'), 600 => t('6:00 AM'), 700 => t('7:00 AM'), 800 => t('8:00 AM'), 900 => t('9:00 AM'), 1000 => t('10:00 AM'), 1100 => t('11:00 AM'), 1200 => t('12:00 PM'), 1300 => t('1:00 PM'), 1400 => t('2:00 PM'), 1500 => t('3:00 PM'), 1600 => t('4:00 PM'), 1700 => t('5:00 PM'), 1800 => t('6:00 PM'), 1900 => t('7:00 PM'), 2000 => t('8:00 PM'), 2100 => t('9:00 PM'), 2200 => t('10:00 PM'), 2300 => t('11:00 PM') );
$opt is being used as options operator by other functions, therefore we need to declare $opt.
So when I do try to exposed my hours I can select the time and I didn't get any error message.
Please let me know if this is working well or not.
Comment #2
HippoOnDiet commenteddouble post :( something wrong with the posting.
Comment #3
HippoOnDiet commentedtriple post
Comment #4
HippoOnDiet commentedHi Guys,
I am now having issue with exposed day filter.
When I select 'any' it will display all the nodes.
But when I filter it to Tuesday, no nodes displayed even though I have a node that is open on Tuesday.
When I check the SQL, I don't think it's right as well.
I did try to open the handler_filter_day.inc and I found out of I change %s with number 1, 2, 3 and so on
then the Where condition in SQL will follow what we change on %s.
WHERE (node.type in ('office_hours')) AND (node_data_field_test_masstimes_value_0.field_test_masstimes_day in ('1, 2, 3, and so on'))Unfortunately I am not really good with coding, therefore any hand to help to fix this issue is much appreciated...
Comment #5
kansaj commentedtry to change to this
Comment #6
johnv@HippoOnDiet, any luck/progress on this?
Comment #7
johnvEven in D7-version, Views integration is not working fine.
See #1364096: Add Views 3 integration: fields, filter criteria, sort criteria, ... [D7]
I'm closing this D6-issue now, since it is not maintained anymore. Patchess are always welcome!