Closed (won't fix)
Project:
Office Hours
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2013 at 10:11 UTC
Updated:
17 May 2013 at 12:54 UTC
In #1168126: Default value for every day of the week a new data structure is proposed:
$items = array(
0 => array(
0=> array(/* 1st day / 1st slot */),
1=> array(/* 1st day / 2nd slot */),
),
1 => array(
0=> array(/* 2nd day / 1st slot */),
1=> array(/* 2nd day / 2nd slot */),
),
2 => array(
0=> array(/* 3rd day / 1st slot */),
1=> array(/* 3rd day / 2nd slot */),
),
...
);
If accepted, the formatter should be addapted (simplified!) to work with this data structure, and then some code at present in the widget could be moved to hook_field_load().
Comments
Comment #1
johnv#1168126: Default value for every day of the week is committed, so the formatter is free for simplification.
However, be aware that hook_field_load() and hook_field_presave() are not called for the default times in the Widget settings.
Comment #2
johnvThis is not possible, as long as the aforementioned hooks are not implemented. See also the following issues:
#1944678: On field settings form, hook_field_load() and hook_field_presave() are not called.
#1994594: hook_field_presave() not called reliably
#1899498: Field default values do not get hook_field_presave() run on them