MyBB Community Forums

Full Version: Missing UnreadPost icon in search.php 1.8.37
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
A line of code has been mistakenly dropped in the search.php code.

Warning appears when viewing a member's profile, then clicking on the Find All Posts link.
If there are unread posts from that member, the results throw a warning.

<error>
	<dateline>1705421544</dateline>
	<datetime>2024-01-16 16:12:24 UTC -0700</datetime>
	<script>search.php(983) : eval()'d code</script>
	<line>2</line>
	<type>2</type>
	<friendly_type>Warning</friendly_type>
	<message>Trying to access array offset on value of type null</message>
	<back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [/search.php(983) : eval()'d code:2]
#2  eval() called at [/search.php:983]
</back_trace>
</error>

Current line 983 is
				eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");
Default template forumdisplay_thread_gotounread references {$thread['newpostlink']} which is not defined in this section.

Previous version 1.8.36 of search.php included a line 983
				$thread['newpostlink'] = get_thread_link($post['thread_lastpost']);
before the template eval code line.
Restoring that line provides the variable definition that is missing.