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');
Comment | File | Size | Author |
---|---|---|---|
#5 | oa_vn_auto_skip_notifications.zip | 2.65 KB | thibaut51 |
Comments
Comment #2
thibaut51 CreditAttribution: thibaut51 commentedComment #3
lionslair CreditAttribution: lionslair commentedShould really be an OA option.
Comment #4
Argus CreditAttribution: Argus as a volunteer commentedI agree with lionslair, converting to feature request.
Comment #5
thibaut51 CreditAttribution: thibaut51 commentedHi 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
Comment #6
Argus CreditAttribution: Argus as a volunteer commentedA ZIP file is not the correct way to contribute. Please check https://www.drupal.org/contribute/development