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).
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | password_policy-sql-error-fix-2726915-4.patch | 2.26 KB | brenk28 |
| #3 | password_policy-sql-error-fix-2726915-3.patch | 1.22 KB | brenk28 |
Comments
Comment #2
brenk28 commentedUpdated version to latest dev.
Comment #3
brenk28 commentedThis patch should fix that error.
Comment #4
brenk28 commentedAfter 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.)
Comment #5
nerdsteinThis is my favorite issue with checkbox fields. Checked -> sets a value, unchecked -> return false.
Thanks for catching this. Merging.