EventUserTrait may return NULL if owner has been deleted

Created on 28 March 2025, 11 days ago

Problem/Motivation

The Recurring Events module provides the EventUserTrait to implement EntityOwnerInterface.

In this interface the getOwner() function specifies the return value to be a UserInterface instance. However if the owner of the event is subsequently deleted then the implementation in the trait will return NULL. This is not an allowed return value according to the specification.

Proposed resolution

Update the implementation in the trait to return the anonymous user if the user does not exist.

A similar topic has been discussed for Drupal Core and returning User::getAnonymousUser() seems to be the agreed upon solution.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

2.0

Component

Recurring Events (Main module)

Created by

🇩🇰Denmark kasperg

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024