Commit 2602dd4c authored by gnuget's avatar gnuget Committed by greggles

Issue #2850935 by gnuget: Error when the user has been created and edit his profile for first time

parent 6102a1b3
......@@ -191,7 +191,7 @@ function comment_notify_form_user_form_alter(&$form, FormStateInterface &$form_s
/** @var \Drupal\user\UserInterface $user */
$user = $form_state->getFormObject()->getEntity();
$notify_settings = $user->id() ? comment_notify_get_user_notification_setting($user->id()) : comment_notify_get_default_notification_setting();
$notify_settings = $user->id() && comment_notify_get_user_notification_setting($user->id()) ? comment_notify_get_user_notification_setting($user->id()) : comment_notify_get_default_notification_setting();
$form['comment_notify_settings'] = array(
'#type' => 'details',
......
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