Closed (fixed)
Project:
Office Hours
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2013 at 19:45 UTC
Updated:
19 Mar 2013 at 22:20 UTC
Jump to comment: Most recent file
Using office_hours for the module name, field type, widget, formatter, FAPI element and theme functions is... confusing.
I propose to rename office_hours form element to office_hours_slot since this element provides rows for the week table.
Also I've seen the opportunity to reorder things and get rid of function _office_hours_get_field_settings().
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | office_hours-1913018.patch | 13.67 KB | jonhattan |
| #2 | office_hours-1913018.patch | 20.55 KB | jonhattan |
| #1 | office_hours-1913018.patch | 9.35 KB | jonhattan |
Comments
Comment #1
jonhattan-38 lines of code for clarity :)
Comment #2
jonhattanI realized this element was named office-hours-block in some places. More renaming.
Comment #3
jonhattanCorrect patch.
Comment #4
johnv- This is a good idea, but renaming 'block' to 'slot' (in the css file) is not backwards compatible. Let's stick with 'block'.
- the removal of
hook_field_is_empty()is just a clean-up?- _office_hours_get_field_settings() has some provision for Profile2. Isn't that lost? (I can't find it right now, but another issue changes that part, too.)
Comment #5
jonhattanI'm fine with keeping the backward compatibility for css. It can be changed in a 2.x branch.
About profile2: My guess is that problem is in other place, and this code is there to circumvent it, and it is no longer needed once the widget revamp proposed in #1168126: Default value for every day of the week is committed.
Almost the same as #1689296: Add more hours link won't work with Field collection module, but I have no evidence. I'll try to replicate the problem with profile2 and check if my stack of patches fixes it.
Comment #6
johnvThe renaming is committed here.
It took me a while to untangle your untangle-patches. :-)
The 'get rid of _office_hours_get_field_settings()' part is not committed, mainly because of the Profile2-issue.
I'm closing this issue. You can provide a patch for the remaining part in a new issue on latest dev-version.