Ensure all entities with an owner gracefully fallback to anonymous owner after truncating all user tables

Created on 2 February 2023, almost 2 years ago

Problem/Motivation

When user tables are truncated, then entities with owner (i.e. "node") still have a user ID value, but references to not existing user. It causes some errors or failures in Drupal.

Steps to reproduce

- Create a user
- Create a node and set owner to recently created user
- Truncate all user tables
- Create a new user to log in
- Go to edit the created node - it throws an error

Proposed resolution

Have a fallback to set owners to 0 (anonymous user) when there is no ability to load an author.

Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

🇧🇾Belarus spleshka UAE

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

Comments & Activities

Production build 0.71.5 2024