ValidReferenceConstraintValidator reloads the parent entity even it does not need to

Created on 13 January 2021, almost 4 years ago
Updated 5 March 2024, 10 months ago

Problem/Motivation

ValidReferenceConstraintValidator::validate() calls loadUnchanged() on the parent entity every time but it uses this data only if there is an invalid target ID.
This can reduce performances with a slow storage backend and a lot of entity reference fields.

Proposed resolution

Only load the entity if there is an invalid target ID.

Remaining tasks

I will submit a patch.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Entity 

Last updated about 16 hours ago

Created by

🇫🇷France prudloff Lille

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