Default time value is absurd

Aren Cambre - November 3, 2008 - 04:55
Project:Autosave
Version:6.x-1.1
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The default value for Autosave under admin/settings/autosave is 10,000 seconds, which is 166 minutes. That is so long that you might as well have the module disabled.

Please use a reasonable value as the default. I'd suggest 120 seconds.

#1

dman - November 3, 2008 - 05:15

That would be 10,000 milliseconds.
The default period value used is '10'
The javascript setimeout in the module code multiplies the period up from seconds into milliseconds as required by the func.

Perhaps you've got something else wrong if you are not seeing the updates happen.

#2

Aren Cambre - November 3, 2008 - 14:47

It's seconds unless there is a UI error. See attachment.

AttachmentSize
Autosave seconds.png 64.38 KB

#3

dman - November 3, 2008 - 15:12

Curious.
The code that generates that page Is this:

<?php
/**
* Menu callback; return the autosave module settings form.
*/
function autosave_admin_settings() {
  if (!
file_exists(AUTOSAVE_PATH .'/jquery.field.js')) {
   
drupal_set_message(t('Unable to find the jQuery Field Plugin in !path. Please <a href="http://plugins.jquery.com/files/jquery.field.js_4.txt">download jquery.field.js</a> and place it into !path.', array('!path' => $path)), 'error');
  }

 
$form['autosave_period'] = array(
   
'#type' => 'textfield',
   
'#title' => t('Autosave after this amount seconds has passed'),
   
'#default_value' => variable_get('autosave_period', 10),
  );
  return
system_settings_form($form);
}
?>

*shrug*

#4

liquidcms - December 2, 2008 - 02:50
Status:active» closed

Yup, as far as i can see the code default for this is 10 sec.

#5

Aren Cambre - December 2, 2008 - 03:55
Component:Code» User interface
Status:closed» active

Then the UI needs to say milliseconds, not seconds. See the PNG I attached.

#6

liquidcms - December 2, 2008 - 04:10

I think you missed my/our points. The UI isnt' in ms it is in seconds; the code says 10 (seconds) the module defaults to 10 seconds. No idea you have managed to set yours to 10,000 seconds without knowing it.

I just (now) added the module to both a new Dr5 and new Dr6 site and sure enough the default comes up as 10 (seconds) - as the code would suggest it would.

Perhaps you are using a settings.php file of unknown origin?? I know i occasionally set the autosave time in my settings.php $conf to "disable" the module (in a multi developer environment where we have multiple developers with their own test sites - run as multisites - if this doesnt make sense; likely not your issue.).

#7

dman - December 2, 2008 - 04:11
Status:active» closed

out-of-the-box default value in the UI
Unable to replicate on a clean 6--1-1 install.
You can get that result by entering that number in the form yourself, but the default is - as clearly shown in the code - "10".
    '#default_value' => variable_get('autosave_period', 10),
And a picture means it must be true:

AttachmentSize
Autosave-default_value.png 6.5 KB
 
 

Drupal is a registered trademark of Dries Buytaert.