when i created the user using the profile type

Created on 17 September 2023, about 1 year ago
Updated 9 December 2023, 11 months ago

The version of Drupal I am using is 10.1.3 and the version of module profile I am using is 8.x-1.7

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] => local_patient [:db_insert_placeholder_2] => 623b0217-0185-42a8-b255-04b207f9e8fc [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => a:0:{} [:db_insert_placeholder_7] => 1694917878 [:db_insert_placeholder_8] => 1694917878 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php)

🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇮🇳India vishal-yadav

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.

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India viren18febS

    Hi @vishal-yadav

    I have checked the issue in Drupal10.1.3 & Profile 8.x-1.7, but I am not able to reproduce the issue. Please provide the steps for reduce the issue.

  • 🇫🇷France jeremy_p

    Hi,

    We have the same issue on our project and i was able to reproduce with a fresh install.

    1. - Install Drupal 10.1.3
    2. - Install Profile 8.x-1.7 and enable it
    3. - Create a new Profile type, with option "Include in user registration form" and a role
    4. - Create a new user and Save

    and then i have the same error as @vishal-yadav :

    Integrity constraint violation: 1048 Column 'uid' cannot be null: INSERT INTO "profile"...

    However, this does not happen with the version 8.x-1.x-dev.

  • Assigned to viren18febS
  • Status changed to Active about 1 year ago
  • 🇮🇳India viren18febS

    Checking the issue!

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India viren18febS

    Hi @vishal-yadav

    I have checked the above mentioned patch, its working. please review here.
    https://www.drupal.org/files/issues/2023-07-24/handle-user-is-anonymous-...

  • 🇺🇸United States derekw

    Had the same problem and switching to -dev resolved it for me.

  • 🇮🇹Italy trickfun

    Patch works fine.
    Thank you

  • 🇪🇸Spain abelass

    Patch works fine on 1.1.5

  • Status changed to Closed: duplicate about 1 year ago
  • 🇺🇸United States asherry

    I had this same issue and it seems to be fixed by the patch in #8 in 🐛 Drupal 10.1: fatal error on account creation Fixed , but more importantly it appears to be exactly the same error that's laid out in that issue.

    I'm going to close this and mark it as a duplicate so that it's easier for people to reference.

  • 🇮🇳India vishal-yadav

    thank you for your response

  • 🇩🇪Germany Fulgrim

    got same error from using is 8.x-1.7:

    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] => b4d7f19f-2ce8-4011-85ce-5b9bbfb4ea8f [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => a:0:{} [:db_insert_placeholder_7] => 1702131196 [:db_insert_placeholder_8] => 1702131196 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of /var/www/mrstea_app/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

    switching to dev solve the issue.

Production build 0.71.5 2024