zingaburga / XThreads-MyBB-Plugin

A powerful MyBB plugin which provides a flexible environment for administrators to perform various modifications.
http://mybbhacks.zingaburga.com/showthread.php?tid=288
24 stars 6 forks source link

Php 8.0 support #30

Open JimTR opened 3 years ago

JimTR commented 3 years ago

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)

zingaburga commented 3 years ago

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.

JimTR commented 3 years ago

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

katjalennartz commented 1 year ago

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.

zingaburga commented 1 year ago

Thanks, made a fix, see if that works.

ghost commented 1 year ago

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.

cryptic-widow commented 1 year ago

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

zingaburga commented 1 year ago

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