Problem/Motivation

When using the find_text module to search content on Drupal 11.4.7, if any indexed node has a deleted or missing owner, an AJAX error occurs with a fatal error: "Call to a member function getDisplayName() on null."

Steps to reproduce

  1. Install find_text module on Drupal 11
  2. Create a node and publish it
  3. Delete the node's author user account (or programmatically set uid to 0)
  4. Use the find_text search form at /admin/find-text to search for text
  5. The AJAX request fails with fatal error in SearchForm->buildNodeResultRow() at line 742

Proposed resolution

Add a null check before calling getDisplayName() on the node owner. If the owner is null, display 'N/A' instead of crashing.

Also update the catch block to handle Throwable in addition to Exception to prevent null dereference errors from crashing the entire request.

CommentFileSizeAuthor
find_text-null-owner-fatal.patch695 bytesuri_frazier

Comments

uri_frazier created an issue.

cskeers’s picture

This should be fixed in #3633967 (c706783a). A missing owner shows a blank author instead of a fatal error.