php TypeOf error if node has been deleted

Created on 4 October 2022, about 2 years ago
Updated 10 November 2023, about 1 year ago

Problem/Motivation

If a user visits a path /node/1234/whatlinkshere, but that node 1234 has been deleted, the user is shown a WSOD with a php error message:

TypeError: Drupal\whatlinkshere\LinkManager::getReferenceContent(): Argument #1 ($entity) must be of type Drupal\Core\Entity\EntityInterface, null given, called in /home/gwulocom/domains/gwulo.com/public_html/web/modules/contrib/whatlinkshere/src/Controller/WhatLinksHereController.php on line 120 in Drupal\whatlinkshere\LinkManager->getReferenceContent() (line 300 of /home/gwulocom/domains/gwulo.com/public_html/web/modules/contrib/whatlinkshere/src/LinkManager.php)

Steps to reproduce

Proposed resolution

Could they see a "404 Page not found" instead?

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

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