No longer existing entity returns a 500

Created on 11 June 2024, 7 months ago

Problem/Motivation

When a entity no longer exists, but the URL is still in some search results, or peoples favorites.
The page returns a 500 error:

Call to a member function access() on null in Drupal\media_download_all\Controller\DownloadController->access()

Steps to reproduce

  1. Create entity with media to download
  2. Go to the specific media_download_all URL, see that it's working
  3. Delete the entity
  4. Revisit the URL

Proposed resolution

Check if we actually have an entity, and it seems to be a common use case to just return forbidden in that case.

Remaining tasks

Add the entity isset check

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇳🇱Netherlands ricardopeters

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