Error: Call to a member function hasLinkTemplate() on null

Created on 6 April 2024, 8 months ago
Updated 12 April 2024, 7 months ago

Problem/Motivation

Avoid an exception thrown when a source entity cannot be loaded in service Usage::detailedUsage.

The website encountered an unexpected error. Please try again later.
Error: Call to a member function hasLinkTemplate() on null in Drupal\entity_usage_addons\Service\Usage->detailedUsage() (line 131 of modules/contrib/entity_usage_addons/src/Service/Usage.php).

Proposed resolution

Add a check right after the entity is loaded before accessing entity methods and attributes.

๐Ÿ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain missvengerberg

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

Comments & Activities

Production build 0.71.5 2024