Problem/Motivation

\Drupal\Core\Entity\EntityLastInstalledSchemaRepository::getLastInstalledDefinition() causes deprecations when called with an entity type ID of NULL.

Steps to reproduce

Run \Drupal\KernelTests\Core\Entity\EntityQueryRelationshipTest::testInvalidSpecifier

Proposed resolution

Throw an exception earleier and make it way more helpful than the current exception which is PluginNotFoundException with the message The "" entity type does not exist. - which is utterly meaningless.

Remaining tasks

User interface changes

None

Introduced terminology

N/a

API changes

I think changing the exception here is fine. The old exception is misleading and I think it is actually a bug.

Data model changes

None

Release notes snippet

N/a

Issue fork drupal-3557505

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
Issue tags: +PHP 8.5
Parent issue: » #3546535: [meta] Deal with NULL as array key/offset
alexpott’s picture

Issue summary: View changes
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Random javascript and functional test failures, re-running green

Running locally with 8.5.0RC3 1 test triggered 2 PHP deprecations:
With the MR 0

Change LGTM

Going on a limb and assuming new exception doesn't need a CR.

catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

The method can already end up throwing a QueryException this just makes that happen potentially in more situations.

Committed/pushed to 11.3.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • catch committed 99867562 on 11.3.x
    fix: #3557505 \Drupal\Core\Entity\EntityLastInstalledSchemaRepository::...

  • catch committed 59fd86e6 on 11.x
    fix: #3557505 \Drupal\Core\Entity\EntityLastInstalledSchemaRepository::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.