Error 'Not null violation' on update #7211

Created on 9 February 2023, almost 2 years ago

Problem/Motivation

When I try to update, i have a PDOException :

webform_confirm_email module
Update #7211
    Failed: PDOException : SQLSTATE[23502]: Not null violation: 7 ERREUR: une valeur NULL viole la contrainte NOT NULL de la colonne « confirmed » dans la relation « webform_submissions » DETAIL: La ligne en échec contient (1, 1, 1, 1, 0, 0, 1640268305, 1640268305, 1640268305, 0.0.0.0 null).: UPDATE webform_submissions SET confirmed=:db_update_placeholder_0 WHERE (confirmed = :db_condition_placeholder_0) ; Array ( [target] => default [return] => 2 [already_prepared] => 1 ) dans webform_confirm_email_update_7211() (ligne 172 dans /var/www/forms/web/profiles/yakforms_profile/modules/webform_confirm_email/webform_confirm_email.install).
<!--break-->

Steps to reproduce

Try to update old version.

Proposed resolution

replace :

function webform_confirm_email_update_7211() {
  db_change_field('webform_submissions', 'confirmed', 'confirmed', array(
    'description' => 'Timestamp of when the email address for this submission was first confirmed, otherwise NULL',
    'type'        => 'int',
  ));
  ...
}

by

function webform_confirm_email_update_7211() {
  db_change_field('webform_submissions', 'confirmed', 'confirmed', array(
    'description' => 'Timestamp of when the email address for this submission was first confirmed, otherwise NULL',
    'type'        => 'int',
    'not null'    => FALSE,
  ));
  ...
}
🐛 Bug report
Status

Active

Version

2.20

Component

Code

Created by

🇫🇷France gbrousse

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024