If I create a new user and set "Notify user of new account" that user gets the email, uses the 1-time login url and logs in and is forced to change his password. On save the following error is thrown:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATEHY000: General error: 1366 Incorrect integer value: '' for column 'field_password_expiration_value' at row 1: INSERT INTO
{user__field_password_expiration} (entity_id, revision_id, bundle, delta, langcode, field_password_expiration_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( :db_insert_placeholder_0 => 86 :db_insert_placeholder_1 => 206 :db_insert_placeholder_2 => user :db_insert_placeholder_3 => 0 :db_insert_placeholder_4 => en :db_insert_placeholder_5 => ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->saveToDedicatedTables() (line 1264 of /core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Comments

brenk28 created an issue. See original summary.

brenk28’s picture

Version: 8.x-3.0-alpha2 » 8.x-3.x-dev

Updated version to latest dev.

brenk28’s picture

This patch should fix that error.

brenk28’s picture

Version: 8.x-3.x-dev » 8.x-3.0-alpha2
StatusFileSize
new2.26 KB

After further testing, realized that the above patch didn't fix the issue. What looks like is happening is that 'field_password_expiration' can come back from the user form as "false". I'm not sure why that is occurring, so this new patch doesn't fix the root cause, but checks if it is false and sets to 0 if so.

(Also, updated the version back to the alpha2 as that's what we are currently using.)

nerdstein’s picture

Status: Active » Fixed

This is my favorite issue with checkbox fields. Checked -> sets a value, unchecked -> return false.

Thanks for catching this. Merging.

  • nerdstein committed c7fd1e5 on 8.x-3.x authored by brenk28
    Issue #2726915 by brenk28: Error on password reset save
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.