Missing user_id definition and rename user_id in uid

Created on 6 April 2022, almost 3 years ago
Updated 4 March 2025, 5 days ago

Problem/Motivation

We noticed that "user_id" was called in getters and setters but the field definition is missing. We had errors on Drupal 8.9 on entity save :
Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user_id' in 'field list'.
In other modules, this field is generally called "uid".

Steps to reproduce

I'm not sure if this error is triggered with an association of modules. I cannot reproduce the error with a fresh install of Drupal 9

Proposed resolution

Add the "uid" column in the schema and rename "user_id" in "uid".
Add a hook update to add the column.

Data model changes

Add the "uid" column.

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇫🇷France madchris

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024