Advertisement:

Author Topic: PHP7 breaks the Add Moderator/Admin comment facility  (Read 334 times)

Offline NaturistCorner

  • Newbie
  • *
  • Posts: 4
PHP7 breaks the Add Moderator/Admin comment facility
« on: November 02, 2019, 07:46:10 AM »
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

Online d3vcho();

  • Sempiterno
  • Lead Localizer
  • SMF Hero
  • *
  • Posts: 3,965
  • Gender: Male
    • frandominguez03 on GitHub
Re: PHP7 breaks the Add Moderator/Admin comment facility
« Reply #1 on: November 02, 2019, 07:49:45 AM »
What are the current mods installed on the forum?

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

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,507
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: PHP7 breaks the Add Moderator/Admin comment facility
« Reply #2 on: November 02, 2019, 07:54:03 AM »
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: PHP7 breaks the Add Moderator/Admin comment facility
« Reply #3 on: November 02, 2019, 08:07:01 AM »
Well, the issue the OP has was fixed in 2.0.7/2.0.8, I’d start with getting that upgraded first...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline NaturistCorner

  • Newbie
  • *
  • Posts: 4
Re: PHP7 breaks the Add Moderator/Admin comment facility
« Reply #4 on: November 02, 2019, 09:47:32 AM »
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?
« Last Edit: November 02, 2019, 10:06:46 AM by NaturistCorner »

Offline NaturistCorner

  • Newbie
  • *
  • Posts: 4
Re: PHP7 breaks the Add Moderator/Admin comment facility
« Reply #5 on: November 02, 2019, 10:03:35 AM »
Here's the ... errr, longish list. Please don't laugh.  ::)

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,507
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: PHP7 breaks the Add Moderator/Admin comment facility
« Reply #6 on: November 02, 2019, 10:38:56 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. 

Offline NaturistCorner

  • Newbie
  • *
  • Posts: 4
Re: PHP7 breaks the Add Moderator/Admin comment facility
« Reply #7 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.

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,507
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: PHP7 breaks the Add Moderator/Admin comment facility
« Reply #8 on: November 02, 2019, 12:22:01 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. 

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: PHP7 breaks the Add Moderator/Admin comment facility
« Reply #9 on: November 02, 2019, 12:32:22 PM »
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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.