Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Douglas on July 14, 2021, 11:02:46 AM

Title: "Someone has posted before you" Alert notifications (RC3)
Post by: Douglas on July 14, 2021, 11:02:46 AM
Quote from: PonderinHog via HogvilleDoug, I'm getting that pesky "Someone has posted before you" warning.  Not a problem now, but when the game threads fire up, it's going to be an issue.

Was this issue addressed in RC4? This needs to be an end-user configurable option under notifications/alerts, with the default being turned OFF.

For smaller sites, this wouldn't be an issue... on Hogville, during game days, we can literally get 100+ replies a minute... Ponderin's right... that's going to royally tick people off, BIG time.

Thanks!
Title: Re: "Someone has posted before you" Alert notifications (RC3)
Post by: Douglas on July 17, 2021, 10:59:26 AM
I've been patient enough, after nearly 3 days.

Allow me to
(https://starecat.com/content/wp-content/uploads/dog-agility-fail-head-bump-gif-animation.gif)

this up. Really need an answer to this, please.
Title: Re: "Someone has posted before you" Alert notifications (RC3)
Post by: shawnb61 on July 17, 2021, 12:54:50 PM
No issue was ever logged.

I just logged one for you:
https://github.com/SimpleMachines/SMF2.1/issues/6851

A workaround is described in this thread:
https://www.simplemachines.org/community/index.php?topic=577845.0

The actual wording is: "Warning - while you were typing a new reply has been posted..."
Title: Re: "Someone has posted before you" Alert notifications (RC3)
Post by: Sesquipedalian on July 17, 2021, 03:08:40 PM
In SMF 2.0 there is a "Don't warn on new replies made while posting" setting in Profile ► Look and Layout. That setting was removed early in the development of SMF 2.1. I have just submitted a pull request that restores that setting to MF 2.1. The PR still needs to be discussed and reviewed by other developers. If and when that PR is merged, members will be able to control this behaviour as they wish, and the admin will be able to set a default for it using Administration Center ► Themes and Layout ► Member Options.

In the meantime, Douglas, if you want a quick and dirty hack to get the behaviour you want, you can make the following two changes in Post.php:




Code (Find) Select

if (isset($_REQUEST['last_msg']) && $context['topic_last_message'] > $_REQUEST['last_msg'])


Code (Replace) Select

if (false && isset($_REQUEST['last_msg']) && $context['topic_last_message'] > $_REQUEST['last_msg'])





Code (Find) Select

if (isset($_POST['last_msg']) && $topic_info['id_last_msg'] > $_POST['last_msg'])


Code (Replace) Select

if (false && isset($_POST['last_msg']) && $topic_info['id_last_msg'] > $_POST['last_msg'])





Obviously, this hack will forcibly prevent the warning from ever being shown in any circumstance whatsoever, so it isn't a good long-term solution. But it should do the job for your use case in the meantime.


EDIT: For what it is worth, I don't think the workaround described in https://www.simplemachines.org/community/index.php?topic=577845.0 is a very good idea. I haven't tested it, but it sure looks like in some circumstances it could result in getting the user stuck in a loop where they still wouldn't be able to post, but would have no idea why.
Title: Re: "Someone has posted before you" Alert notifications (RC3)
Post by: Douglas on July 18, 2021, 03:45:13 AM
Shawn, thank you for logging the issue. :)

Sesqui-WHAT, appreciate the assist and the needed changes, and for the pull request.

Count me amongst those that this definitely needs to be restored back to how it was in SMF 2.0. Something like this is invaluable to so many... and saves a LOT of headaches on larger sites, especially when we have that defaulted to off and give our visitors the opportunity to turn it on.

Again, thank you, both, for jumping on this. It's truly appreciated!