-
-
Notifications
You must be signed in to change notification settings - Fork 345
Description
This is the convergence of three different things, so first some context:
The Log module has logic in it for automatically setting the log name if it is left blank.
This happens after the log is saved so that the log ID is available for token replacement.
farmOS automatically adds setNewRevision(TRUE) whenever logs are saved, to ensure traceability of edits.
farmOS/modules/core/entity/farm_entity.module
Line 164 in c566852
| $entity->setNewRevision(TRUE); |
This results in two revisions whenever a log is saved without a title. The first revision doesn't have a title, and the second does.
This has been an issue all along, it seems. It isn't ideal, but it didn't cause any errors, until recently...
Drupal 11 made a change to it's internal Html::escape() helper method, which requires that its only argument be a string type. In the case described above, the log title is NULL, which means if you click on one of the revisions without a title, you get a white screen (with "The website encountered an unexpected error. Try again later.") and the following error in server logs:
Uncaught PHP Exception TypeError: "Drupal\\Component\\Utility\\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /opt/drupal/web/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 238" at /opt/drupal/web/core/lib/Drupal/Component/Utility/Html.php line 433, referer: http://localhost/log/4/revisions