Closed (fixed)
Project:
Office Hours
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2012 at 15:51 UTC
Updated:
27 May 2013 at 21:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
Ozeuss commentedBug reported by @Lazarus-Long - conflict with valhrs with related commit.
I adapted the patch from a closed issue - attached. will be committed to dev shortly.
Comment #2
Lazarus-Long commentedPatch did not resolve the issue. #valhrs is being included but is not checked in _office_hours_select_process()
Comment #3
johnvIt was not clear to me, but this was fixed..
Comment #4
johnv...but not yet correct according to #2.
Comment #5
johnvCommitted in 479fd13
PS1: This was the cause of #1606744: No values on node edit page.
PS2: The remarks in #1044594-6: Limit widget hours: setting not saving for D6 are also valid for D7.
Comment #6
johnvThere is an error with 'more hours', when being set to '00'.
See attached screendumps, where the value of 'more hours' used to be empty, now '00-00'.
It causes undesired effects on the formatter.
See the last line of screendump 1 and the widget of screendump 2.
Comment #7
Ozeuss commentedChange logic a bit - limit hours and valhrs are different, and either limit can be set.
It seems ok now (more hours are not set to '00') - comments?
Comment #8
johnvI'll try, did you see this (double post by me)?
#1595158-11: Refactored display formatter
#1595158-12: Refactored display formatter
Comment #9
Lazarus-Long commentedThis again ignores the valhrs setting. Even if one or both limits are set, if the valhrs checkbox isn't checked, the limits need to be ignored.
I've moved the limiting logic to _office_hours_limit_hours(), and allowed it to accept just a start or end time, rather than requiring both. We can still require the settings to set both, but this will accommodate any current settings sites may have.
I've also commented out the limiting logic in _office_hours_field_validate() as the values should already be validated by the FAPI. There may be an issue with less-than-an-hour limits though, but those don't seem to be detected by the current logic anyway.
This will probably be the last I work on this as I plan on making a new widget, as described in #1613110: New widget.
Comment #10
johnvRegarding this line:
Is limiting the hours part of 'validate hours' (i.e. works only if 'validate' is set), or a separate functionality?
[EDIT] I'll just make it explicit by changing the helptext: "Assures that endhours are later then starthours. Please note that this will work as long as the opening hours are not through midnight."
Comment #11
johnvOK, thanks, this works.
Added some Coder-changes and committed #7 to 28953ba
Comment #12
johnvboth this and 479fd13 need backporting to D6.
Comment #13
Ozeuss commentedJohnv,
Yes - they are completely separate. valhrs does exactly what you described.
'limit hours' is just for making the widget more 'friendly' by making them compact (since, for example, libraries don't usually need the hours till 7-8am). because of this I wondered if we needed to go through the hassle of validating the limit hours at all. I ended up including it.
thanks for the commit.
Comment #14
johnvI don't think will will backport this anymore.