News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Problems with sceditor

Started by Col, February 21, 2023, 11:16:45 AM

Previous topic - Next topic

Col

@Sesquipedalian I don't think that's the trigger, but I don't know for sure. I was intending to perform some tests today, but I was too busy.

I was able to place my cursor in the above. But maybe where the mention is paced matters too. If I try mentioning you here, @Sesquipedalian, will this trigger the problem? And, yes, it just happened again. I cannot go back to any point after the mention earlier in the paragraph. I can go to prior sentences and and the previous paragraph. What made you think of it, @Sesquipedalian? And one last attempt - still happening with latest mention. And if go to after the second one, the cursor skips to just before the third mention.

Sesquipedalian

Yup, I think this can now be classified as a legitimate, reproducible bug. Inserting mentions in WYSIWYG mode messes with the cursor position when trying to edit the same paragraph that the mention appears in.

As for how I thought of it, @Col, I remember encountering a similar issue with mentions and WYSIWYG mode at some point way back during earlier phases of SMF 2.1's development. I don't recall seeing it for a long while, but either it has resurfaced recently, or perhaps I just haven't done anything to trigger it in a long time.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

TwitchisMental

This is for testing purposes.

edit edit @Sesquipedalian Lorem Ipsum

Stuff and things.

Edit : Humm not reproducing the error myself.  

If someone else can reproduce this and give specifics, we can get this logged on GitHub :) .

Sesquipedalian

To reproduce:

  • Put the following text into the quick reply (replace "@test1" with a username on your test forum):
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. @test1  Aenean tempus justo sed arcu. Sed ut neque. Nam quis odio in nulla dapibus laoreet. Suspendisse interdum volutpat ligula.

    Nullam sagittis nunc quis massa. @test1 Curabitur a pede vel risus mollis dignissim. Aenean nec massa. Vivamus at tellus. Sed ac nunc. Pellentesque feugiat ultricies quam. Ut porta turpis commodo pede dignissim laoreet.
  • Click the preview button to go to the full post authoring form.
  • Click somewhere after the mention in the second paragraph.
  • Observe how the cursor jumps to the end of the paragraph.

Anyway, after digging around a bit, I think I have found the culprit. I'll open an issue and submit a PR on GitHub shortly.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

DeadMan...

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. @Sesquipedalian  Aenean tempus justo sed arcu. Sed ut neque. Nam quis odio in nulla dapibus laoreet. Suspendisse interdum volutpat ligula.

Nullam sagittis nunc quis massa. @Sesquipedalian  Curabitur a pede vel risus mollis dignissim. Aenean nec massa. Vivamus at tellus. Sed ac nunc. Pellentesque feugiat ultricies quam. Ut porta turpis commodo pede dignissim laoreet.



Confirmed for me, too. Good find.
I tell it how I see it... Don't like it? Hit Alt+F4!

Sesquipedalian

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Col

Quote from: Sesquipedalian on February 23, 2023, 08:34:56 PMIssue filed: #7687

Pending fix: #7688

Good job, Sesquipedalian. Reading your pending fix, is this a recent introduction of the bug? Presumably, it is.

Sesquipedalian

Actually, no. The bug just seems to have gone largely unnoticed for all this time. That's probably because it only occurs under certain conditions and not others. My guess is that you have encountered it repeatedly because your particular usage patterns often lead to the triggering conditions. Someone following different usage patterns might rarely ever find their way into the triggering conditions.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Arantor

Quote from: Sesquipedalian on February 24, 2023, 03:15:10 PMSomeone following different usage patterns might rarely ever find their way into the triggering conditions.

*waves hand* Oooh, pick me, pick me!

I almost never mention people, which is why I never noticed this. Good looking fix though.

Sesquipedalian

Yup. In my tests, at least, it only happened when I used a mention, and used WYSIWYG mode, and used the post preview function to view the post, and then tried editing the post text. It didn't happen if I tried editing an already existing post; it didn't happen in the quick reply form before I clicked preview; etc. There may very well be other paths that lead to the triggering conditions besides the one I found, but many paths don't lead there at all.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

live627

Quote from: Col on February 24, 2023, 02:44:57 AMis this a recent introduction of the bug?
looks like teh affected code is there since 2014 (nine years!)

DeadMan...

Quote from: Sesquipedalian on February 23, 2023, 08:34:56 PMIssue filed: #7687

Pending fix: #7688


Is this a fix that maybe can be made into a mod and posted here for the OP to use until it gets into a future update? This way, the OP, who seems to be the one that mostly gets this issue, can have relief until the next update.
I tell it how I see it... Don't like it? Hit Alt+F4!

Sesquipedalian

Constructing a whole modification package would be overkill in this case. If @Col wants to implement the fix on their own forum now, they can just delete the relevant lines in their local copy of mentions.js.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Diego Andrés

Quote from: Sesquipedalian on February 24, 2023, 03:53:06 PMConstructing a whole modification package would be overkill in this case. If @Col wants to implement the fix on their own forum now, they can just delete the relevant lines in their local copy of mentions.js.
It's been done in the past for some 2.0.x fixes, I believe Shawn did it for both the birthday issue and something else.


If someone wants to do it 'right' feel free to do so and share it, but keep in mind it will have to be reverted/uninstalled once the fix makes it onto an actual patch.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Sesquipedalian

Quote from: Diego Andrés on February 24, 2023, 04:54:42 PMIt's been done in the past for some 2.0.x fixes, I believe Shawn did it for both the birthday issue and something else.

Yes. Allow me to rephrase:

Quote from: Sesquipedalian on February 24, 2023, 03:53:06 PMConstructing a whole modification package would be overkill in this case would require more effort than I am willing to exert for something so easy for admins to do locally themselves, especially since making the local edit would itself require less effort from the admin than going through all the steps of installing a mod.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

DeadMan...

Manual fix, or mod, it'll still have to be reverted before updating.
Unless, in the update, it can skip if the fix is already done.
I tell it how I see it... Don't like it? Hit Alt+F4!

Sesquipedalian

It is true that if the change isn't reverted before the next official patch is installed, then SMF's package manager will report that a test failed. In this particular case, however, it would be safe to ignore the warning and proceed to install the patch anyway. That is almost never true, but this is the rare exception.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Col

Quote from: Sesquipedalian on February 24, 2023, 03:15:10 PMActually, no. The bug just seems to have gone largely unnoticed for all this time. That's probably because it only occurs under certain conditions and not others. My guess is that you have encountered it repeatedly because your particular usage patterns often lead to the triggering conditions. Someone following different usage patterns might rarely ever find their way into the triggering conditions.
My usage pattern here is not even my regular usage patterns. Because I experienced bugs in the past with SMF's WYSIWYG editor when I upgraded to 2.0 (I no longer recall the specifics of the bug), I disabled WYSIWYG at my SMF forum. Many of my members struggle with tags, and have made negative comments about it, so trying out WYSIWYG here was on my testing list prior to upgrading to 2.1, as was the use of mentions.

Irrespective of my particular usage here over the past few days, it is odd that it has, apparently, taken 9 years for this bug to come to light.

Thank you, everyone, for your persistence. And, particularly you, Sesquipedalian.

Col

Quote from: Sesquipedalian on February 24, 2023, 03:53:06 PMConstructing a whole modification package would be overkill in this case. If @Col wants to implement the fix on their own forum now, they can just delete the relevant lines in their local copy of mentions.js.
That's what I will do. My members are not, on the whole, remotely technical. They will make heavy use of the WYSIWYG editor and, I expect, mentions too.

Arantor

Quote from: Col on February 25, 2023, 05:37:09 AMit is odd that it has, apparently, taken 9 years for this bug to come to light.

Not really; the mainstream release of 2.1 was last year - in the period of 2011-2022, the (vast) majority of the people using it were devs and fringe communities, both of whom probably habitually use non-WYSIWYG.

Advertisement: