Commit ed562bb8 authored by attiks's avatar attiks Committed by greggles

Issue #1560062 by attiks | geerlingguy: After Drupal 7.14 core update, getting...

Issue #1560062 by attiks | geerlingguy: After Drupal 7.14 core update, getting error Illegal choice 0 in notify_type element
parent 55867747
......@@ -136,7 +136,7 @@ function comment_notify_add_notification($cid, $notify, $notify_hash) {
return (bool)db_insert('comment_notify')
->fields(array(
'cid' => $cid,
'notify' => $notify,
'notify' => $notify === NULL ? 0 : $notify,
'notify_hash' => $notify_hash,
))
->execute();
......@@ -164,7 +164,7 @@ function comment_notify_remove_all_notifications($cid) {
function comment_notify_update_notification($cid, $notify) {
return (bool)db_update('comment_notify')
->fields(array(
'notify' => $notify,
'notify' => $notify === NULL ? 0 : $notify,
))
->condition('cid', $cid)
->execute();
......
......@@ -131,7 +131,7 @@ function comment_notify_form_comment_form_alter(&$form, &$form_state, $form_id)
$form['notify_settings']['notify_type'] = array(
'#type' => 'radios',
'#options' => $available_options,
'#default_value' => $preference,
'#default_value' => $preference ? $preference : NULL,
);
if (count($available_options) == 1) {
$form['notify_settings']['notify_type']['#type'] = 'hidden';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment