Object of class Drupal\user\Entity\User could not be converted to string

Created on 4 November 2021, about 3 years ago
Updated 19 August 2024, 4 months ago

OK, here's another weird one, and I can't even be sure this is actually a Link Checker problem. See this issue as well:

https://www.drupal.org/project/entity_usage/issues/3247778#comment-14281463

Long story short, I have seven sites on which both Link Checker and Entity Usage are installed. When running cron, I get:

Fatal error: Uncaught Error: Object of class Drupal\user\Entity\User could not be converted to string in /Users/dicksb/Sites/MAMP/moweb6/docroot/core/lib/Drupal/Core/Database/StatementWrapper.php:116
Stack trace:
#0 /Users/dicksb/Sites/MAMP/moweb6/docroot/core/lib/Drupal/Core/Database/StatementWrapper.php(116): PDOStatement->execute(Array)
#1 /Users/dicksb/Sites/MAMP/moweb6/docroot/core/lib/Drupal/Core/Database/Connection.php(874): Drupal\Core\Database\StatementWrapper->execute(Array, Array)
#2 /Users/dicksb/Sites/MAMP/moweb6/docroot/core/lib/Drupal/Core/Database/Query/Update.php(148): Drupal\Core\Database\Connection->query('UPDATE {users_f...', Array, Array)
#3 /Users/dicksb/Sites/MAMP/moweb6/docroot/core/modules/user/src/UserStorage.php(59): Drupal\Core\Database\Query\Update->execute()
#4 /Users/dicksb/Sites/MAMP/moweb6/docroot/core/modules/user/src/EventSubscriber/UserRequestSubscriber.php(55): Drupal\user\UserStorage->updateLastAccessTimestamp(Object(Drupal\restrict_by_ip\Session\AccountProxy), 1636061815)
#5 [interna in /Users/dicksb/Sites/MAMP/moweb6/docroot/core/lib/Drupal/Core/Database/StatementWrapper.php on line 116

If I uninstall Entity Usage, the problem goes away.

But also, if I delete all my Link Checker Link Type entities, while leaving Entity Usage installed, the problem also goes away.

Seems like there's some kind of interaction going on...and yet, I have about 40 other sites with both modules installed that are not experiencing this error. Any ideas?

Edit: further testing suggests to me that Entity Usage is not involved in the problem. See https://www.drupal.org/project/linkchecker/issues/3244663#comment-14285129

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States wrd-oaitsd

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

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