Hello,

To avoid unnecessary sending of email, I would like to check by default the "Do no send notification for this update"
- when creating the content
- when editing the content
- when adding some comment

I tried with :
$form['oa_notifications']['skip_notify']['#default_value'] = 1;
or
$form['oa_notifications']['skip_notify']['#attributes'] = array('checked' => 'checked');

Checkbox is checked in both cases, but notification are still sent.
If I uncheck then recheck, no notification are sent.

I think it is because of the ajax callback but I don't know how to fix it.
Any help is welcome.

[SOLUTION]
add javascript :
drupal_add_js('jQuery(document).ready( function ($) { $( "#edit-oa-notifications-skip-notify" ).trigger( "click" ); } )', 'inline');

CommentFileSizeAuthor
#5 oa_vn_auto_skip_notifications.zip2.65 KBthibaut51
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thibaut51 created an issue. See original summary.

thibaut51’s picture

Issue summary: View changes
Status: Active » Fixed
lionslair’s picture

Should really be an OA option.

Argus’s picture

Title: How to skip notification by default » Add an option to switch notification default setting
Category: Support request » Feature request
Status: Fixed » Active

I agree with lionslair, converting to feature request.

thibaut51’s picture

Hi here is a begining of a contrib module

It's works except for event created with the modal form (which open by clicking directly on a day on the calendar section)

I tried to add the JS with ctools_add_js() or ctools_modal_add_js() function with no luck

Does anyone know how to add this JS to a modal page ?

Tibo

Argus’s picture

A ZIP file is not the correct way to contribute. Please check https://www.drupal.org/contribute/development