I've encountered a fairly serious problem (as in, it would be very confusing and annoying for the non-tech-adept person who normally edits the calendar on the site in question). I set the week to start on Sunday, not Saturday, but after editing a couple of months, it keeps reverting back to Saturday for the week start. I've tried flushing all caches and running cron after changing the setting, but it doesn't help.

CommentFileSizeAuthor
#2 1048010.patch490 bytesfietserwin

Comments

matolog’s picture

i have the same problem. does somebody fix this bug ?

fietserwin’s picture

Status: Active » Needs review
StatusFileSize
new490 bytes

On porting the code to D7, I found that saving the settings is done both on editing the node and editing the availability of the node. (This is due to a call to node_save() in function availability_calendars_node_edit_form_submit() which leads to a call to function availability_calendars_nodeapi which calls availability_calendars_save without the settings being initialized.)

The patch is to change the line that calls node_save into cache_clear_all():

old:

function availability_calendars_node_edit_form_submit($form, &$form_state) {
  $nid = check_plain($form_state['values']['nid']);
  $year = check_plain($form_state['values']['year']);
  $month = check_plain($form_state['values']['month']);
  // fix caching issue
  // @todo find a less resource intensive way to do this.
  $node = node_load($nid);
  node_save($node);
  ...

new:

function availability_calendars_node_edit_form_submit($form, &$form_state) {
  $nid = check_plain($form_state['values']['nid']);
  $year = check_plain($form_state['values']['year']);
  $month = check_plain($form_state['values']['month']);
  // fix caching issue #747992: Calendar not updating
  cache_clear_all();
   ...
nicholas.alipaz’s picture

nicholas.alipaz’s picture

Just to note, this will be fixed in upcoming 6.x-1.6 release.

metakel’s picture

I cannot find the option to set the starting day (default is Saturday) on the 6.x-2.x-dev (2011-Mar-07). May I know where or how can I set it to Sunday?

fietserwin’s picture

@metakel: This is a setting that can only be set on the node level, not in the admin settings form. The fix for #764406: Allow admin to hide the 'calendar settings' form on the node edit page changes this, so that it can be set on both levels: global by admin, per node by admin/editor/owner (if per node overrides are enabled).

Status: Fixed » Closed (fixed)

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