Closed (fixed)
Project:
Office Hours
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2011 at 07:17 UTC
Updated:
11 Jun 2011 at 13:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
johnvIt looks like functionality has shifted from function office_hours_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) to _elelemt_info(), loosing the $delta info in the process.
Comment #2
Ozeuss commentedThanks,
http://drupalcode.org/project/office_hours.git/commit/2ca1b9e
Adapted the $items array to accommodate correct date. Please review.
Comment #3
johnvI havne't set up git yet. Would you mind to provide a patch/zip? thanks.
Comment #4
Jerome F commentedYou can just clic on the diff link next to each file in the page to get the patch.
Comment #5
johnvOK, I didn't notice the links before. Thanks for the tip and the patch.
- Edit&Save in Nodes is now OK;
- Edit&save in Content type - Field settings (Edit tab) gives a Notice: Undefined variable: days in _office_hours_arrange_items(). An extra declaration removes the warning:
Comment #6
Jerome F commentedJust a little patch to test what johnv suggested in #5 as it did remove the notice :
Notice: Undefined variable: days in _office_hours_arrange_items() (line 331 of (...)/sites/all/modules/office_hours/office_hours.module).appart from that, the git version in #2 seems ok to me for saving hours in standard content type.
But once I edit the node the weight modifications are lost, so if I put sunday at the end of the list, on save it's ok, on edit it's back to weight 0 so in firts position (back to default). Being able to put sunday at the end is a standard use case in France for example.
(things get even worse if the field is used with Profile2 profile types, see: http://drupal.org/node/1126386)
Comment #7
johnvJerome, IMO I'd rather not have the weight handles on the edit page. I believe OO uses the default/system first-day-of-week . You can set it here: admin/config/regional/settings
Can you change to order in D6, too?
Comment #8
Jerome F commented@johnv: are you sure OO uses the default/system first-day-of-week? you're right it was set on sunday but when I changed it to monday it didn't refresh the field. So I created a new OO field to test that and it's also set on sunday though I am now on monday.
Appart from that I don't see why we would need the handles either.
Comment #9
johnvJerome, indeed, the first-day-of-week isn't working, as reported in #1115868: First day configuration. It's not possible..
A short recap:
- patch #2 is committed as Office Hours 7.x-1.x-dev (2011-Apr-10)
- patch #5 /#6 is now in #1171772: Undefined variable: days in _office_hours_arrange_items()
- First-day-of-week is not working: see #1115868: First day configuration. It's not possible.
- Edit-page shows weight handles, which should either - be removed - be able to set the first-day-of week. This is outside fo this issue. A new issue should be created for this.
Comment #10
johnvClosing this issue, since a) initial issue is resolved, b) main patch #2 is committed, c) all other issues are reported elsewhere