Hey there, I'm trying to set some reasonable min/max values for my content type, so that the hours selection doesn't start with 0, but rather with 7 or so, but whenever I save the field configuration form, if I go back to it, the values are gone..

Any hints?

THanks!

Comments

johnv’s picture

Indeed, in the settings form the start hours are not saved correctly, and have the same value as the end hours.

johnv’s picture

Title: Limit widget hours setting not saving » Limit widget hours: setting not saving

Updating title. More issues report having problems with this field.

ntg’s picture

Any updates on this bug?

johnv’s picture

Can't find the cause of this weird problem. Any patches are welcome.

Ozeuss’s picture

Status: Active » Needs review
StatusFileSize
new9.59 KB

For some reason we've used 'office_hours_select' as an element, but it doesn't really make sense because limiting hours concerns hours and not minutes and you can't decide which time format to use - so I've reverted to using a simple select box and using both.

A patch is supplied, please test, seems to work for me.

johnv’s picture

Status: Needs review » Fixed

This is a very nice piece of work! Enabling the not-allowed hours is a good thing.
It has one drawback, a per the next example:
- edit a node, set the hours to 9-17
- set the allowed values to 10-18
- edit the node again, the invalid hours are now empty, without showing a warning.

I could not apply your patch. Then I noticed that it was already committed to 6.x-1.x, so I am correcting the status.

johnv’s picture

Status: Fixed » Needs work
StatusFileSize
new1.18 KB

And attached patch corrects some trailing spaces and code styling (no return + break).

johnv’s picture

Status: Needs work » Fixed

Also committed.

Status: Fixed » Closed (fixed)

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