Commit 10be7251 authored by Sophie Shanahan-Kluth's avatar Sophie Shanahan-Kluth Committed by Paulo Henrique Cota Starling
Browse files

Issue #3269065 by Sophie.SK, the_g_bomb: Data too long for column...

Issue #3269065 by Sophie.SK, the_g_bomb: Data too long for column 'field_last_password_reset_value': incorrect datetime format
parent 6d8fcd6e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -311,9 +311,10 @@ function _password_policy_user_profile_form_update_fields(array &$form, FormStat
  // Update if both current and new password fields are filled out. Depending
  // on policy settings, user may be allowed to use same password again.
  if ($uid && ($current_pass || $form_state->get('user_pass_reset')) && $new_pass) {
    $date = \Drupal::service('date.formatter')->format(\Drupal::time()->getRequestTime(), 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE);
    $form_state->setValue(
      'field_last_password_reset',
      [['value' => new DrupalDateTime()]]
      [['value' => $date]]
    );
    $form_state->setValue('field_password_expiration', ['value' => '0']);
    $form_state->setValue('field_pending_expire_sent', ['value' => '0']);