Error while trying to access comment edit page

Created on 12 December 2019, about 5 years ago
Updated 17 January 2025, 7 days ago

I'm working on a 8.8.0 Drupal installation (running on php 7.3.12).
I've first uninstalled the "comment" module and than I've enabled it and I've created a new comment type, called "comment" and added a comment field to a content type (with translation enabled).
Everything works but if I try to go to http://localhost:9999/it/comment/3/edit I obtain a blank page and dblog tells me:

Error: Call to a member function isLanguageAlterable() on null in language_entity_field_access() (line 416 of /var/www/html/web/core/modules/language/language.module)

Line 415 and 416 are these:

$config = ContentLanguageSettings::loadByEntityTypeBundle($entity->getEntityTypeId(), $entity->bundle());
return AccessResult::forbiddenIf(!$config->isLanguageAlterable());

The problem is that $entity->bundle() returns NULL and so also $config is NULL.
If I replace $entity->bundle() with my comment bundle name (comment), that page works (even if the edit form does not display all fields, but only "subject").

I've not custom modules enabled and this is a "fresh" installation (with configuration but without contents).

🐛 Bug report
Status

Closed: duplicate

Version

9.2

Component

comment.module

Created by

🇮🇹Italy arrubiu

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