This error occurs on all pages following a migration from Drupal 6 to Drupal 8.

Presumably it is triggered by data. It is an old site with 93,000 comments. I do not expect a fix for this issue but I do need to publish this patch so that the composer build includes the fix I have made.

Feel free to close the issue.

CommentFileSizeAuthor
comment-label.patch722 bytesNewZeal

Comments

New Zeal created an issue. See original summary.

shane birley’s picture

Is this the error you received:

Error: Call to a member function label() on null in Drupal\comment\Entity\Comment->getAuthorName() (line 407 of core/modules/comment/src/Entity/Comment.php).

NewZeal’s picture

Yes, that looks familiar.

shane birley’s picture

I am thinking this is all related:

Just wanting to document this all since your fix technically "hacks" core -- but your solution does work! The comments system appears to have problem dealing with the null setting on old comments (in my case, migrated from Drupal 6) with user accounts that no longer exist, etc.

rajesh.keladimath’s picture

I had a problem with the cron execution in 8.7.7 version. Cron was not running because of the error mentioned in the #2. After applying the patch cron execution was successful.

Version: 8.5.3 » 8.5.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Version: 8.5.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lendude’s picture

Status: Active » Closed (works as designed)

Is there any way to get into this state in a non-migration way? Migrations can save incomplete entities, so in that case this error is just doing it's job, reporting on a broken entity.

As pointed out by @NewZeal when reporting this, this might not need to be fixed. So tentatively closing this as 'Works as designed', feel free to reopen this if somebody can reproduce this or feels we actually should allow comments without authors.