Fix Prevent fatal error when entity cannot be loaded

Created on 8 September 2025, 23 days ago

Problem/Motivation

When viewing the Content Planner Kanban board, a fatal error occurs:

Error: Call to a member function toUrl() on null in Drupal\content_kanban\Component\KanbanEntry->build() (line 103)

This happens because the code attempts to call toUrl() on a null entity. The entity load may fail if:

The referenced entity ID no longer exists in the database

Entity data is corrupted

Database inconsistencies exist

As a result, the entire Kanban board page becomes inaccessible.

Steps to reproduce

  • Enable Content Planner – Content Kanban module.
  • Navigate to the Content Kanban page (/admin/content/kanban).
  • Ensure there are orphaned or missing entities referenced.
  • Observe the fatal error:
    Call to a member function toUrl() on null

Proposed resolution

Add a null check after entity loading to prevent fatal errors.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇯🇴Jordan Rajab Natshah Jordan

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