D10 : New profile on registration form throw an error

37 views Asked by At

Profile 1.7 and drupal 10.1.6

Inside a register form with profile, after upgrading to D10, the profile can't be save anymore.

It seems like the profile is created before the user, this could explain the "uid cannot be null"

Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null: INSERT INTO "profile" ("revision_id", "type", "uuid", "status", "uid", "is_default", "data", "created", "changed") 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, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => customer [:db_insert_placeholder_2] => dce9e93d-959a-45b6-92ab-50fc5040f8e3 [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => a:0:{} [:db_insert_placeholder_7] => 1699544958 [:db_insert_placeholder_8] => 1699544958 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php). 

I thought about altering the save() function from User entity to handle profiles separately, but it seems too risky for what it is

0

There are 0 answers