Remove unnecessary User::load from domain_entity_entity_access

Created on 17 November 2022, about 2 years ago
Updated 4 October 2024, about 2 months ago

In domain_entity_entity_access there is an unnecessary User::load to check whether the user has the administrator role. The AccountInterface has the getRoles method available.

Additionally, this can also cause an error in certain circumstances (batch processing) as the User may be null:
Error: Call to a member function hasRole() on null in domain_entity_entity_access() (line 461 of /modules/contrib/domain_entity/domain_entity.module)

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom intrafusion Edinburgh, UK

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.

Production build 0.71.5 2024