Less complexity and more performances in FocalPointManager::getCropEntity()

Created on 18 March 2025, 18 days ago

Problem/Motivation

In \Drupal\focal_point\FocalPointManager::getCropEntity(), we use \Drupal\crop\Entity\Crop::cropExists() before calling \Drupal\crop\Entity\Crop::findCrop() or creating a new Crop entity.
This can cause a point of failure when cropExists returns TRUE and findCrop returns NULL (this can happen during migrations or content deployment for example) and it adds an unneeded database request.

Proposed resolution

Only use the \Drupal\crop\Entity\Crop::findCrop() method and test its result.

📌 Task
Status

Active

Version

2.0

Component

Other Code

Created by

🇫🇷France duaelfr Montpellier, France

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