Quantcast
Viewing all articles
Browse latest Browse all 295826

Fatal error when passing non-existing ID to entity parameter converter

Problem/Motivation

The bundle filter which was introduced in the entity parameter converter doesn't check if an entity exists before calling methods on it, resulting in a fatal error when a non-existing entity ID is passed in:

Error: Call to a member function bundle() on null in core/lib/Drupal/Core/ParamConverter/EntityConverter.php:145

Steps to reproduce

Pass a non-existing entity ID and a bundle filter to EntityConverter::convert().

Proposed resolution

Don't call methods on nullable objects without checking if they are NULL.

Remaining tasks

Review and commit.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A


Viewing all articles
Browse latest Browse all 295826

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>