What changed in the latest dev version to make a reminder for a node type ON (checked) by default? That's really annoying when a date is required. Any chance that can be changed back to the previous way of having it OFF (unchecked) by default?

Am I missing a setting hidden away somewhere? If this is the maintainer's wish to have reminder's required by default, then this module can't possibly work for most use cases.

Comments

capfive’s picture

I really need this to be available, even just the fucntion to turn it off by default.

We have a consultation form that is allowed to filled out by anonymous users and it needs to have a reminder set off by default so they can fill it out, otherwise they get the error

Your "" email address is not valid
Jason Dean’s picture

This does seem odd. I changed the default value using a hook_form_alter() in a custom module.

Or change line 103 of node_reminder.module for a quick hack:

'#default_value' => isset($reminder->active) ? $reminder->active : false,
capfive’s picture

I will implement this until a more solid solution arises :)

Much thanks for the help pushka!

capfive’s picture

I was able to implement a form alter so it won't be wiped up in any future updates :)

but thanks again this pushed me on the right path.

For anyone else wanting to know this is what I did:

1. Create a custom module for form alter

2. implement the following code

<?php
function MODULENAME_form_consultation_node_form_alter(&$form, &$form_state, $form_id) {
  $form['reminder'] = array(
    '#type' => 'fieldset',
    '#title' => t('Reminder'),
	'#group' => 'additional_settings',
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#access' => user_access('set node reminders'),
  );

  $form['reminder']['active'] = array(
    '#title' => t('Enabled'),
    '#type' => 'checkbox',
    '#default_value' => isset($reminder->active) ? $reminder->active : true,
  );

  $form['reminder']['reminder_email'] = array(
    '#title' => t('Email Address'),
    '#description' => t('Email address that the reminder will be sent to. Multiple email addresses can be separated by a comma.'),
    '#type' => 'textfield',
    '#size' => 60,
    '#default_value' => '',
  );

  $form['reminder']['amount_of_time'] = array(
    '#title' => t('Amount of time'),
    '#description' => t('The amount of time which will trigger the reminder.  E.G., 3, as in \'3 days\''),
    '#type' => 'textfield',
    '#maxlength' => 2,
    '#size' => 2,
    '#default_value' => $reminder->amount_of_time ? $reminder->amount_of_time : '3',
  );

  $form['reminder']['unit_of_time'] = array(
    '#title' => t('Unit of time'),
    '#type' => 'select',
    '#options' => array(
      'days' => t('Days'),
    ),
    '#default_value' => $reminder->unit_of_time ? $reminder->unit_of_time : 'days',
    '#required' => TRUE,
  );

  $form['reminder']['repeat_enabled'] = array(
    '#title' => t('Repeat Reminder'),
    '#type' => 'checkbox',
	'#default_value' => $reminder->repeat_enabled ? true : false,
  );

  $form['reminder']['note'] = array(
    '#title' => t('Note'),
    '#type' => 'textarea',
    '#description' => t('Send a note in the reminder'),
    '#default_value' => $reminder->note ? $reminder->note : 'Automatically generated reminder',
  );

  return $form;
}
?>

If someone could help me with simplifying this code that would be great but it is working at it is :)

deanflory’s picture

Thanks pushka, simple and quick.