Sleeping hat shown before it's active.
Summary
A time limited sleeping hat should not be actively shown before its beginning date.
Steps to reproduce
Set a sleeping hat (Schlafmütze) starting some time in the future.
What is the current bug behavior?
Sleeping hat is immediately shown and one is listed at the bottom of a store's team list.
What is the expected correct behavior?
This should only happen starting from the sleeping hat's starting date.
Relevant error messages and/or screenshots
Possible fixes
Probably something about sleep_status
, sleepmode
and sleeping_hat
. Maybe https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src/Modules/Foodsaver/FoodsaverGateway.php 's listActive*
and listInactive*
functions need to check the date range, but I haven't dug deeper...
Checking the sleeping range when requesting the status from the database might be good solution (see comment below). We would need to check in which cases the existing requests can be replaced by that.