OH is displaying "Closed" when input is 4:00 PM to 10:00 PM.

Initially I input 4pm-10pm and it displayed "Closed". Now I can change any of the hours 10am-10pm, 3pm-10am, 3pm-4pm... no matter what the setting Sunday displays as "Closed". 14 hour blocks are enabled.

Any thoughts?

Comments

bstrange’s picture

I am going to go out on a limb and assume this is something that no one else using the dev version has experienced (at least I couldn't find any other mentions of this in queue) and that the immediate solution would be for me to roll back to last stable.

Ozeuss’s picture

I couldn't reproduce this bug.
What are your settings?
Could you try and replicate this after turning "closed" off?

bstrange’s picture

So sorry for the long delay, been extremely busy lately.

I can't find anywhere to turn closed off. I have looked everywhere. The only settings I could find were required checkbox, number of values, hours format, granularity of time, limit for start and end times, validate hours, display 'add more hours', and show empty days.

If you could point me in the right direction, that would be outstanding. I am thinking maybe my upgrade from earlier version was in some way corrupted?

bstrange’s picture

Ok, to be absolutely certain, I deleted all office hours fields from all content types, then disabled and then uninstalled office hours. I deleted the folder from sites/all/modules and then reuploaded the current dev version. Enabled, ran update.php, then added office hours to a single content type and created two nodes.

In both cases, regardless of what times are entered into "Sunday", Sunday always shows up as closed, or not present if 'show empty days' is unchecked.

To troubleshoot, I am going to repeat the process only this time I am going to go manually rummage through the database and see if there are any latent pieces of office hours left over, that is the only explanation I can think of.

Also, I still cannot find any dropdown or checkbox option for "closed" as you mentioned in #2. My Global settings contain only the following:

Required (unchecked)

Number of values:
14

Hours format:
12 hrs

granularity of time:
Half hours

Limit widget start hours: (untouched)

Validate hours (unchecked)

Display the "Add more hours" link (unchecked)

Show empty days (checked currently)

Thanks in advance :)

I will update after I root through DB after uninstall and post findings.

bstrange’s picture

I couldn't find any leftovers in the db; however, I noticed in the content_field_office_hours table, Sunday, in all nodes, shows up with a delta value of '0' and a field_office_hours value of '0'. This seems contrary to the way the other field and deltas work for Mon-Sat. For example, Monday entries for all nodes show up with a delta value of '2' and a field_office_hours value of '1'. Tuesday shows up with a delta value of '4' and a field_office_hours value of '2' and so on and so on....

Unlike Mon-Sat whose delta value is double the field_office_hours value, Sunday is 0 / 0. I think this may be the problem but I am uncertain...just making an observation. It could be working as intended, I honestly have no idea; but regardless, no mater what I do, no mateer how many times i uninstall/reinstall and go through the DB, Sunday is always displayed as "Closed" regardless of time selection.

ionmedia’s picture

same problem
dsm for OH array here:

0 (Array, 3 elements) 
day (String, 1 characters ) 0 
starthours (String, 3 characters ) 900 
endhours (String, 4 characters ) 1500 
1 (Array, 3 elements) 
day (NULL) 
starthours (NULL) 
endhours (NULL) 
2 (Array, 3 elements) 
day (String, 1 characters ) 1 
starthours (String, 3 characters ) 800 
endhours (String, 4 characters ) 1800 
3 (Array, 3 elements) 
day (NULL) 
starthours (NULL) 
endhours (NULL) 
4 (Array, 3 elements) 
day (String, 1 characters ) 2 
starthours (String, 3 characters ) 800 
endhours (String, 4 characters ) 1800 
5 (Array, 3 elements) 
day (NULL) 
starthours (NULL) 
endhours (NULL) 
6 (Array, 3 elements) 
day (String, 1 characters ) 3 
starthours (String, 3 characters ) 800 
endhours (String, 4 characters ) 1800 
7 (Array, 3 elements) 
day (NULL) 
starthours (NULL) 
endhours (NULL) 
8 (Array, 3 elements) 
day (String, 1 characters ) 4 
starthours (String, 3 characters ) 800 
endhours (String, 4 characters ) 1800 
9 (Array, 3 elements) 
day (NULL) 
starthours (NULL) 
endhours (NULL) 
10 (Array, 3 elements) 
day (String, 1 characters ) 5 
starthours (String, 3 characters ) 800 
endhours (String, 4 characters ) 1800 
11 (Array, 3 elements) 
day (NULL) 
starthours (NULL) 
endhours (NULL) 
12 (Array, 3 elements) 
day (String, 1 characters ) 6 
starthours (String, 3 characters ) 900 
endhours (String, 4 characters ) 1600 
13 (Array, 3 elements) 
day (NULL) 
starthours (NULL) 
endhours (NULL) 

there is all looks fine

sunday is [0] key in the array, but on page i see sunday closed

adiatis’s picture

Problem solved by editing line 17 in dev version in office_hours.theme.inc.

Before:
Line 17: if (!empty($day)) {

After:
Line 17: if ($day!='') {

Sunday is index '0'.
The problem is function empty(). The following things are considered to be empty:

* "" (an empty string)
* 0 (0 as an integer)
* "0" (0 as a string)
* NULL
* FALSE
* array() (an empty array)
* var $var; (a variable declared, but without a value in a class)

You have to try it with several OH settings. I don't know if it's right for all of them. I show every day, even if they are closed.

Good luck ;-)

h1ghpr0’s picture

confirm #7 does fix problem with first day of OH shown as "closed" or not displayed depending on "Show empty days" setting regardless of the OH for first day.

Uninstall / reinstall module did not fix problem.

johnv’s picture

Status: Active » Fixed

committed to D6.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.