Entry element query missing user field data when user is suspended
User queries by default will only return active users, not pending or suspended ones.

To include suspended users, change this line:



$user = $entry-&gt;user-&gt;one();


to this:

$user = $entry-&gt;user-&gt;status(['active', 'suspended'])-&gt;one();


Or if you want to include pending users as well (users who haven’t activated their account yet), you can do this:

$user = $entry-&gt;user-&gt;anyStatus()-&gt;one();