This code appears to break in 8.8
https://www.drupal.org/project/eck/issues/2994838

Error: Call to a member function label() on null in /var/www/html/web/modules/contrib/eck/src/Controller/EckEntityListBuilder.php on line 44 #0 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityListBuilder.php(235)

I attached a patch of the fix I am using for my D8 instance IDK if this is something I configured with an entity wrong. The only thing that may have been different was my entity did not have the title property selected.

Comments

RecursiveMeta created an issue. See original summary.

RecursiveMeta’s picture

StatusFileSize
new941 bytes

Rerolled using git to patch

RecursiveMeta’s picture

Ok after some more digging. my bet is I was passing a bundle name when creating an entity programmatically via

$this->entityTypeManager()
->getStorage('my_entity_type')
->create([ 'type' => 'doh_forgot_part_bundle_string', ...]);

Staying up till 3am writing code is always a risky gamble haha.

Either way programmer typo in data can break the ListBuilder and offending entities in DB would need to be removed. My patch does allow you to visualize the data error tho.

morrisem’s picture

Thanks for the patch. I got the 'type' wrong when creating an entity instance. Your patch (#2) allowed me to bring up the Content list and delete the offending instance.

jimmynash’s picture

Here is a second thanks. In trying to create these my entities with the Business Rules module I got the type wrong as well.

The patch in #2 helped me get rid the the bad ones I created during testing.

matroskeen’s picture

Status: Active » Needs review
Related issues: +#2452267: Entities can be created programatically without titles or with bogus bundle names
StatusFileSize
new901 bytes

It appears that this issue exists in Drupal core (see related issue).
Anyway, I'm happy to commit a fix for the error on the listing page, so here is a new patch that keeps the original bundle label.

  • Matroskeen committed 92a2870 on 8.x-1.x
    Issue #3106184 by RecursiveMeta, Matroskeen: EckEntityListBuilder error...
matroskeen’s picture

Status: Needs review » Fixed

Committed to 8.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

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