(2022-12-14, 12:37 PM)HLFadmin Wrote: [ -> ]1. Look to see if showthread.php is not altered.
AdminCP / Tools and Maintenance / File Verification
Only admin/backups/.htaccess is listed with Status = Changed (which is expected).
(2022-12-14, 12:37 PM)HLFadmin Wrote: [ -> ]2. Check if modifications to showthread template.
AdminCP / Templates & Style / Templates / Default Templates / expand Showthread Templates
Click Options button and view Diff Report of showthread. Any text in template highlighted in color?
The only option under the Options button is "Full Edit".
(2022-12-14, 12:37 PM)HLFadmin Wrote: [ -> ]3. Verify this segment exists in the showthread template.
<tr>
<td class="tfoot">
{$search_thread}
<div>
<strong>« <a href="{$next_oldest_link}">{$lang->next_oldest}</a> | <a href="{$next_newest_link}">{$lang->next_newest}</a> »</strong>
</div>
</td>
</tr>
It exists, and matches what you provided as lines 57-64.
(2022-12-14, 12:37 PM)HLFadmin Wrote: [ -> ]4. View Diff Report on showthread_search template in that same group. Any modifications?
It should look like this.
<div class="float_right">
<form action="search.php" method="post">
<input type="hidden" name="action" value="thread" />
<input type="hidden" name="tid" value="{$thread['tid']}" />
<input type="text" name="keywords" value="{$lang->enter_keywords}" onfocus="if(this.value == '{$lang->enter_keywords}') { this.value = ''; }" onblur="if(this.value=='') { this.value='{$lang->enter_keywords}'; }" class="textbox" size="25" />
<input type="submit" class="button" value="{$lang->search_thread}" />
</form>
</div>
Looks identical to what you provided on my installation.
(2022-12-14, 12:37 PM)HLFadmin Wrote: [ -> ]If you provide a link to your forum, I will take a look.
Sure thing, please see
https://dv.netllama.us/dv/ .
(2022-12-14, 01:18 PM)Matt Wrote: [ -> ]Oh actually looking at it, the variable may be undefined if searching is not allowed - have you set the permissions so that the forum can't be searched?
No, searching works fine on my forum, even for unauthenticated users.
(2022-12-14, 04:20 PM)HLFadmin Wrote: [ -> ]There is only one place $search_thread is defined, in showthread.php
800 // Can this user perform searches? If so, we can show them the "Search thread" form
801 if($forumpermissions['cansearch'] != 0)
802 {
803 eval("\$search_thread = \"".$templates->get("showthread_search")."\";");
804 }
805
In the event cansearch is 0, is PHP8 calling $search_thread as undefined rather than assuming a null value?
Can test by adding a line to define it as null before performing test. Adding
$search_thread = "";
before the if statement may solve. The fix may be a core edit.
Adding that initialization of $search_thread before line 801 appears to fix this bug. Thank you!
What's the process for getting this fix into the official myBB code base in a future release?
I spoke too soon. The original failure is gone, but now I'm getting two new failures, also inside of showthread.php:
Type: 2
File: showthread.php (Line no. 256)
Message
Undefined variable $cutoff
Back Trace:
#0 errorHandler->email_error(2, Undefined variable $cutoff, showthread.php, 256) called at [/var/www/html/dv/inc/class_error.php:229]
#1 errorHandler->error(2, Undefined variable $cutoff, showthread.php, 256) called at [/var/www/html/dv/inc/class_error.php:153]
#2 errorHandler->error_callback(2, Undefined variable $cutoff, /var/www/html/dv/showthread.php, 256) called at [/var/www/html/dv/showthread.php:256]
Type: 2
File: showthread.php (Line no. 243)
Message
Undefined variable $lastread
Back Trace:
#0 errorHandler->email_error(2, Undefined variable $lastread, showthread.php, 243) called at [/var/www/html/dv/inc/class_error.php:229]
#1 errorHandler->error(2, Undefined variable $lastread, showthread.php, 243) called at [/var/www/html/dv/inc/class_error.php:153]
#2 errorHandler->error_callback(2, Undefined variable $lastread, /var/www/html/dv/showthread.php, 243) called at [/var/www/html/dv/showthread.php:243]
I guess I need to initialize more variables somewhere to fix this too?
Is there an easier way to find all the uninitialized variables at once?