News:

Wondering if this will always be free?  See why free is better.

Main Menu

PHP7 breaks the Add Moderator/Admin comment facility

Started by NaturistCorner, November 02, 2019, 07:46:10 AM

Previous topic - Next topic

NaturistCorner

I upped the php version on our server from php5.6 to php7.2  All seemed to be well before I got message from one of my Moderators that when adding a Moderator comment to a post he got the following error message ... "The message body was left empty" when attempting to save the amended post.  Adding any mod comment also fails the same.  I tried all php7.x versions with the same result.

There are no error messages showing on the server. However looking on the SMF error log (General) I see the following:

xxxxxxx index.php?action=post2;start=0;msg=224461;c9a98148=f7feea4da8947d1955577b95aa0e1a5a;board=49Apply Filter: Only show the errors with the same message8192: preg_replace(): The /e modifier is deprecated, use preg_replace_callback insteadApply Filter: Only show the errors from this file File: /data01/c5562449/public_html/community/Sources/Subs-Post.php
Line: 271


There are 3 versions of this error message at the same time-point.

Sorry but I didn't do any initial installation of SMF for the website, nor have I added any further mods .... I 'inherited' the site a year or so ago.

Can anyone give me at least a pointer as to where to start looking at the issue?

Many thanks

John

d3vcho

"Greeting Death as an old friend, they departed this life as equals"

lurkalot

d3vcho(); beat me to the reply while I was typing, but,

You'll need to roll your php version back and wait for 2.0.16 to come out before moving to 7.2 I'm afraid.  2.0.15 supports up to 7.1 but that will also depend on what mods you have installed and whether they support it.

Anyway, here's the system requirements, https://wiki.simplemachines.org/smf/SMF2.0:Requirements_and_recommendations

Arantor

Well, the issue the OP has was fixed in 2.0.7/2.0.8, I'd start with getting that upgraded first...

NaturistCorner

#4
Thanks guys for what you've said so far. But, oooops, I did miss out a vital bit of info in that my SMF is 2.0.15.  Specifically I tried it on both php7.0 and 7.3, same result.

There ARE a lot of Mods installed ..... and probably many have not been updated for a while but in my Package Manager they are all shown as Status: Green. Given the type of error, if I put up a list of them here could anyone give me an inspired guess as to where to start?  Is that possible?

NaturistCorner

Here's the ... errr, longish list. Please don't laugh.  ::)

lurkalot

Quote from: NaturistCorner on November 02, 2019, 09:47:32 AM

if I put up a list of them here could anyone give me an inspired guess as to where to start?  Is that possible?


At a guess I would say it's this mod, "Moderator and Administrator Comment Tags" based off this topic, https://www.simplemachines.org/community/index.php?topic=334033.msg3928714#msg3928714

But at the end of the day you really should keep your mods and themes updated to minimise issues like this. 

NaturistCorner

Hey Lurkalot  ..... many thanks for taking the time on this. So, I'm assuming that if I replace the code as per the post you pointed to then this will make my world completely happy again?

The only thing I don't understand .......

Quote But at the end of the day you really should keep your mods and themes updated to minimise issues like this.

I'm a complete numpty as far as SMF is concerned but I'm pretty advanced on WP and have written a fair few thousands of lines of code in php. So can you tell me why is it that the SMF Package Manager on this site is giving me a green light (quote 'Installed Mods - Current Version') on every single one?  As a (SMF) non-tech user just not understanding that one.

lurkalot

Quote from: NaturistCorner on November 02, 2019, 12:05:21 PM
Hey Lurkalot  ..... many thanks for taking the time on this. So, I'm assuming that if I replace the code as per the post you pointed to then this will make my world completely happy again?

The only thing I don't understand .......

Quote But at the end of the day you really should keep your mods and themes updated to minimise issues like this.

I'm a complete numpty as far as SMF is concerned but I'm pretty advanced on WP and have written a fair few thousands of lines of code in php. So can you tell me why is it that the SMF Package Manager on this site is giving me a green light (quote 'Installed Mods - Current Version') on every single one?  As a (SMF) non-tech user just not understanding that one.

Well that mod in particular was updated to version 1.9 before the author removed it from the mods site, and it had compatibility for higher php versions added.  Unfortunately your still using version 1.8.  I've no idea if replacing that code will fix your problem, but worth a try I guess.  Just make sure you backup first.

If you check any of the mods on your list above, you can then search for it on the mods site and see if there's a newer version.  You will have to check with them on the best way to update individual mods. Some have to be uninstalled and new one installed, and some will install over the top of the existing in form of a upgrade.

Green lights just showing what's installed, it doesn't mean it'll work. 

Arantor

The green light also relates to the fact that you can theoretically have multiple versions of a mod to be installed and that would show you the most recent of them.

Advertisement: