XThreads-MyBB-Plugin icon indicating copy to clipboard operation
XThreads-MyBB-Plugin copied to clipboard

Php 8.0 support

Open JimTR opened this issue 4 years ago • 7 comments

is there any plans to do a php 8 conversion ? I have done some of the simple things like converting '{0}' to '[0]' but I am a bit stuck on admin/modules/config/threadfields.php when it creates a new record .. can not find out where the field names are read in PHP 8 gives an error like Warning [2] Undefined array key "hidefield" - Line: 269 - File: admin/modules/config/threadfields.php PHP 8.0.8 (Linux)

JimTR avatar Jul 05 '21 14:07 JimTR

Looks like PHP 8 is quite brutal to this code base. Actually I'd imagine it was quite the thing for MyBB itself as many of the coding practices that was used there now generate warnings.

I've fixed a bunch of issues, but there's undoubtedly more.

zingaburga avatar Jul 08 '21 05:07 zingaburga

So far everything appears to work but to date I have not tried everything, I'll post back any errors that show up later

JimTR avatar Jul 10 '21 08:07 JimTR

hey, seems like the 'mark threads as read' (as logged in user) function doesn't work any more in php8 if x thread is installed.

katjalennartz avatar Jan 02 '23 08:01 katjalennartz

Thanks, made a fix, see if that works.

zingaburga avatar Jan 06 '23 13:01 zingaburga

I've got a problem with the forum status icons on index, indicating that I have unread posts without actually having unread posts. Marking a forum or all forums as read doesn't change anything. I figured it's related to your (awesome) plugin.

I fixed this by using some variables the way it's usually done in mybb: global $cache, $db, $templates instead of using $GLOBALS['cache'] and so on. I just did this in one particular function (inc/xthreads/xt_forumdhooks.php -> xthreads_global_forumbits_tpl()) since I didn't notice any other issues. But to make this work I also had to fix some minor php 8 warnings from mybb core files, which probably will be fixed with the next update.

Idk but it works. Maybe this helps for further fixes.

ghost avatar Jan 06 '23 18:01 ghost

Running PHP 8.2 on MyBB 1.8.36. Not sure if this will be of any help but I'm getting the following: 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 802 Warning Undefined array key "fid23" 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 802 Warning Undefined array key "fid9" 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 802 Warning Undefined array key "fid8" 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 802 Warning Undefined array key "fid11" 5 minutes ago inc/plugins/xt_proffields.php 803 Warning Undefined variable $html 5 minutes ago inc/plugins/xt_proffields.php 802 Warning Trying to access array offset on value of type null

cryptic-widow avatar Sep 15 '23 12:09 cryptic-widow

I'm guessing it's an issue with https://github.com/Sama34/Additional-Settings-For-Custom-Profile-Fields

zingaburga avatar Sep 15 '23 12:09 zingaburga