MyBB Community Forums

Full Version: PHP 8 error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I havent update my forum for the last few months.

So updated from 1.8.31 to 1.8.34

I have been using PHP 7.4 all these years, and I upgrade them to 8.2

But seeing many errors.

Tested with 8.0, 8.1 also produce error, but change back to 7.4 error is gone.

Please assist me thanks.


The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 32 - File: global.php(961) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/global.php(961) : eval()'d code 32 errorHandler->error_callback
/global.php 961 eval
/index.php 18 require_once

Warning [2] Undefined property: MyLanguage::$forumteam - Line: 19 - File: index.php(406) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/index.php(406) : eval()'d code 19 errorHandler->error_callback
/index.php 406 eval

Warning [2] Undefined variable $dvz_shoutbox - Line: 15 - File: index.php(468) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/index.php(468) : eval()'d code 15 errorHandler->error_callback
/index.php 468 eval

Warning [2] Undefined property: MyLanguage::$forum_locked - Line: 26 - File: index.php(468) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/index.php(468) : eval()'d code 26 errorHandler->error_callback
/index.php 468 eval

Warning [2] Undefined property: MyLanguage::$forum_locked - Line: 27 - File: index.php(468) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/index.php(468) : eval()'d code 27 errorHandler->error_callback
/index.php 468 eval
(2023-07-01, 03:52 PM)safiedin Wrote: [ -> ]I havent update my forum for the last few months.

So updated from 1.8.31 to 1.8.34

I have been using PHP 7.4 all these years, and I upgrade them to 8.2

But seeing many errors.

Tested with 8.0, 8.1 also produce error, but change back to 7.4 error is gone.

Please assist me thanks.
these are not errors, these are warnings

Quote:The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 32 - File: global.php(961) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/global.php(961) : eval()'d code 32 errorHandler->error_callback
/global.php 961 eval
/index.php 18 require_once

your templates are not up to date and have probably not been maintained for ages

Go to the template "header" and search for:
{$unreadreports}
and replace it with:
{$modnotice}



Quote:Warning [2] Undefined property: MyLanguage::$forumteam - Line: 19 - File: index.php(406) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/index.php(406) : eval()'d code 19 errorHandler->error_callback
/index.php 406 eval
missing language variable


Quote:Warning [2] Undefined variable $dvz_shoutbox - Line: 15 - File: index.php(468) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/index.php(468) : eval()'d code 15 errorHandler->error_callback
/index.php 468 eval
if you don't use the DVZ-Shoutbox anymore, you should remove the variable $dvz_shoutbox from the template index


Quote:Warning [2] Undefined property: MyLanguage::$forum_locked - Line: 26 - File: index.php(468) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/index.php(468) : eval()'d code 26 errorHandler->error_callback
/index.php 468 eval

Warning [2] Undefined property: MyLanguage::$forum_locked - Line: 27 - File: index.php(468) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/index.php(468) : eval()'d code 27 errorHandler->error_callback
/index.php 468 eval
wrong language variables

in index template search for


 <dt><span class="forum_status forum_offlock" title="{$lang->forum_locked}"></span></dt>

 <dd>{$lang->forum_locked}</dd>

change to

 <dt><span class="forum_status forum_offclose" title="{$lang->forum_closed}"></span></dt>

 <dd>{$lang->forum_closed}</dd>
Thank you so much for the help

I have followed your instruction and manage to solve them.

Except for this error

Warning [2] Undefined property: MyLanguage::$forumteam - Line: 19 - File: index.php(406) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/index.php(406) : eval()'d code 19 errorHandler->error_callback
/index.php 406 eval

When you say 
Quote:missing language variable

I seriously don't know what to do to fix this.

Could you show what do I have to do?

Also how do i update the template to latest one? Like you said I do not maintain them properly.
sorry, for this problem I have no solution, never seen before

let's take a look on it

index.php line 406
here is in original index.php a template called: index_boardstats
please check this template in acp if it is in original state, reset if necessary

edit: I searched again
please remove
<a href="showteam.php">{$lang->forumteam}</a>
from index_boardstats Template


to your templates
if you use a style that has a lot of changes to the templates, they will not be processed during the MyBB update. This must then be done manually.
In the German supportboard we have an overview of the changes. It would be important to know the status of your style, when it was last updated by the designer.

The changes I posted yesterday are e.g. changes to the templates that came with MyBB 1.8.20, so your style is before that version.

It's a lot of work to rework all that, maybe a new updated style would be the easier solution, but look for yourself:
https://www.mybb.de/doku/sonstiges/geaen...templates/
i am currently using the standard theme that came with mybb forum board. (default template)

if i am not mistaken few years back i tried to change to another theme but got some issue.

so i revert back to the original theme.

is there anyway that i can use the latest standard theme that came with mybb ( the most updated ones). Do you know how we can do that?

my theory is, to install a new mybb system, and then just import the database. But i have about 20GBs attachment as well. do i import them directly to upload directory after? WIsh somebody can assist me on this.

**

i delete the line at boardstats and warning is gone.

THANK YOU  Heart
just install the default theme again under a new name; you can find it under install/resources/mybb_theme.xml in the current download archive
please install with templates

You now have a second style, but this one doesn't have your possibly installed plugins in it yet.
For this you have to deactivate (not uninstall) the plugins once and activate them again.

If everything works, you set the new style as default style and deactivate the other one for the users.


for your idea please read this post from Matt: https://community.mybb.com/thread-237253.html
(2023-07-02, 01:47 PM)bv64 Wrote: [ -> ]just install the default theme again under a new name; you can find it under install/resources/mybb_theme.xml in the current download archive
please install with templates

You now have a second style, but this one doesn't have your possibly installed plugins in it yet.
For this you have to deactivate (not uninstall) the plugins once and activate them again.

If everything works, you set the new style as default style and deactivate the other one for the users.


for your idea please read this post from Matt: https://community.mybb.com/thread-237253.html

had a good read on Matt's post. Thanks.

so how do we install default theme again?
What do i do with the mybb_theme.xml?

I see the file at the directory.

Update:

Not sure whether its the correct way
I tried install default theme by going to ACP - create new theme - select default base and new name

So under themes i have the NEW DEFAULT 2023 theme under Default theme (name that is easy to remember)

Set as default theme.

But now if i click on a thread,
I see new warning

Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 43 - File: showthread.php(1621) : eval()'d code PHP 8.2.7 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1621) : eval()'d code 43 errorHandler->error_callback
/showthread.php 1621 eval
choose at ACP
Templates & Styles --> Themes --> Import a theme
choose the xml
let Parent Theme on MyBB Master Style
give New Name
import stylesheets and templates
Owh!

Thanks for showing the way.

Now i can see the light at the end of the tunnel!

Happen to see this link as well - same steps like you showed me https://docs.bitnami.com/virtual-machine...ll-themes/

Now i don't see any warnings at all.

I buy you a cup of coffee if you live near me bro.

Million thanks again!
great that it worked, you're welcome
Pages: 1 2 3